Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I fix this code?


dailce

Recommended Posts

This is in regards to PayPal IPN Shopping Cart 3.0a When you select itemized and charge tax on shipping and tax on the product the original code would not add the correct taxes up.

 

For instance, the total before checkout:

 

Item = $100

Shipping = $10

GST 7% + PST 8% = $15

GST on shipping + PST on shipping = $1.50

Total = $126.50

 

When the buyer checks out the PayPal_Shopping_Cart_IPN brings you to PayPal and only adds the following:

 

Item = $100

Shipping and Handling = $10

Sales Tax (GST 7% + PST 8%) = $15

Total = $125.00

 

It doesn't add/include the tax on shipping, I think it has to do with the code below, I just can't get it to work right.

 

FILE include/modules/payment/paypal.php

 

 

Itemized Order Details
      for ($i=0,$index=1; $i<sizeof($order->products); $i++, $index++) {
        //$index = $i+1;
        $paypal_fields .= tep_draw_hidden_field('item_name_'.$index, $order->products[$i]['name']).
        tep_draw_hidden_field('item_number_'.$index, $order->products[$i]['model']).
        tep_draw_hidden_field('quantity_'.$index, $order->products[$i]['qty']).
        tep_draw_hidden_field('amount_'.$index, number_format($order->products[$i]['final_price']* $my_currency_value,2));
        

$tax = (($order->products[$i]['final_price'] * ($order->products[$i]['tax'] / 100)) * $my_currency_value;


        $paypal_fields .= tep_draw_hidden_field('tax_'.$index, number_format($tax, 2));

Link to comment
Share on other sites

 

Have you tried looking or posting in the support thread?? Best place to get help.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

  • 8 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...