I ported a Westpac WebAdvantage payment module from oscommerce and there is just one small problem with it.
If I purchase more than one of the same product with different attributes, the payment module only charges for one product.
This must have something to do with how product with attribute's quantities are calculated.
Can someone tell what needs to be changed in this function to fix the problem?
Code:<?php function process_button() { global $order, $currencies, $currency; $tax_rate = 0; $process_button_string = zen_draw_hidden_field('vendor_name', MODULE_PAYMENT_WEBADVANTAGE_MERCHANT_ID) . zen_draw_hidden_field('payment_alert', MODULE_PAYMENT_WEBADVANTAGE_MERCHANT_EMAIL) . zen_draw_hidden_field('print_zero_qty', 'false'); foreach($order->products as $key => $value) { if($value['tax']>0) { $process_button_string .= zen_draw_hidden_field($value['name'], $value['qty'].','.$value['final_price']); $tax_rate = $value['tax']; } else { $process_button_string .= zen_draw_hidden_field($value['name'] . ' *', $value['qty'].','.$value['final_price']); $process_button_string .= zen_draw_hidden_field('gst_exempt_fields', $value['name'] . ' *'); } } if($tax_rate > 0) { $process_button_string .= zen_draw_hidden_field('gst_rate', $tax_rate); $process_button_string .= zen_draw_hidden_field('gst_added', 'false'); $process_button_string .= zen_draw_hidden_field('gst_exempt_fields', 'Shipping Method: '.$order->info['shipping_method'] . ' *'); } $process_button_string .= zen_draw_hidden_field('Shipping Method: '.$order->info['shipping_method'] . ' *', '1,'.$order->info['shipping_cost']); $process_button_string .= zen_draw_hidden_field('receipt_address', $order->customer['email_address']); $process_button_string .= zen_draw_hidden_field('return_link_text', 'To Complete Your Order You Must Click Here To Finish Payment and Return to Circus Arts.'); $process_button_string .= zen_draw_hidden_field('return_link_url', zen_href_link(FILENAME_CHECKOUT_PROCESS,'bank_reference=&payment_number=&remote_ip=')); return $process_button_string; } ?>



