Zen Follower
- Join Date:
- Sep 2005
- Location:
- Austria
- Posts:
- 99
- Plugin Contributions:
- 1
[Done v1.5.0] PayPal Express: Item details are shown as Tax included in prices: 0 (0)
Zen-Cart 1.3.9h
Fresh installation
No addons
Issue:
Some Products (depending on price and tax rate) are shown in PayPal Express as:
Tax included in prices: 0 (0)
How to recreate this issue:
Set Configuration > My Store > Display Prices with Tax > true
Set your tax rate to 19%
Set your currency to EUR
This is the configuration for almost all German shops as the German VAT is 19% (or for some products 7%)
Create a product with the following price:
Products Price (Gross): 0.90
Tax Class: 20%
The net price will be: 0.7563
Add this product to your cart and checkout with PayPal Express
The PayPal website will show the content of your cart as:
Tax included in prices: 0 (0)
In the PayPal log you will find:
getLineItemDetails 5
Line-item subtotals do not add up properly. Line-item-details skipped.
0.9 0Array
(
[AMT] => 0.9
[ITEMAMT] => 0.9
[TAXAMT] => 0
[SHIPPINGAMT] => 0
[SHIPDISCAMT] => 0
[HANDLINGAMT] => 0
[INSURANCEAMT] => 0
[L_NUMBER0] => 1234567
[L_NAME0] => Testproduct
[L_AMT0] => 0.899997
[L_QTY0] => 1
)
Notice the difference between AMT and L_AMT0
Create a product with the following price:
Products Price (Gross): 1.19
Tax Class: 20%
The net price will be: 1.0000
Add this product to your cart and checkout with PayPal Express
The PayPal website will show the content of your cart as it should be
In the log you will see:
[AMT] => 1.19
[ITEMAMT] => 1.19
[TAXAMT] => 0
[SHIPPINGAMT] => 0
[SHIPDISCAMT] => 0
[HANDLINGAMT] => 0
[INSURANCEAMT] => 0
[L_NUMBER0] => KABHD40PIN
[L_NAME0] => Testproduct
[L_AMT0] => 1.19
[L_QTY0] => 1
[CODE]
According to the PayPal Express API documentation:
Regardless of the specified currency, the format must have decimal point with exactly two digits to the right
This is not the case in the current code, so we suggest the following change in includes/modules/payment/paypalwpp.php
change around line 1192
from
[CODE]
$optionsLI["L_AMT$k"] = $order->products[$i]['final_price'];
$optionsLI["L_QTY$k"] = $order->products[$i]['qty'];
$optionsLI["L_TAXAMT$k"] = zen_calculate_tax(1 * $order->products[$i]['final_price'], $order->products[$i]['tax']);
to
$optionsLI["L_AMT$k"] = round($order->products[$i]['final_price'], 2);
$optionsLI["L_QTY$k"] = $order->products[$i]['qty'];
$optionsLI["L_TAXAMT$k"] = round(zen_calculate_tax(1 * $order->products[$i]['final_price'], $order->products[$i]['tax']), 2);
After this change checkout again the 0.90 Euro product and now the product is shown in PayPal correctly as there is no difference between AMT and L_AMT0 anymore
hugo13 and webchills





