Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2005
    Posts
    64
    Plugin Contributions
    1

    Default Help needed with custom payment module

    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;
        } ?>

  2. #2
    Join Date
    Dec 2005
    Posts
    64
    Plugin Contributions
    1

    Default Re: Help needed with custom payment module

    I got around this by adding a unique identifier to the product name in tpl_checkout_confirmation.php (around line 160) like this:

    <?php $order->products[$i]['name'] = $order->products[$i]['name'] . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));?>


    This adds the attribute values to the product name before it is passed to the Westpac web advantage site.

    Does anyone know how I can add an id # to the products name instead of the attribute values?

 

 

Similar Threads

  1. custom payment module help with coupons
    By jouba in forum Addon Payment Modules
    Replies: 2
    Last Post: 20 May 2011, 04:37 PM
  2. Help needed with getting Paygate payment module to work
    By LeneZone in forum Addon Payment Modules
    Replies: 5
    Last Post: 4 Nov 2009, 11:43 AM
  3. Urgent Help needed with Secure Hosting Payment module
    By snellc in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 8 May 2009, 04:32 PM
  4. Help needed with the heartland payment module
    By superprg in forum Addon Payment Modules
    Replies: 2
    Last Post: 20 Feb 2009, 10:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg