Originally Posted by
UsaCanBag
I am using paypal IPN for payment processing with line items turned on
Here is what's happening. Customer goes through the check out and upon reaching paypal, cart items are missing and the total is wrong. What gets me is that only some of the items are missing. I have tried to recreate the problem with some success.
I have an item that I am giving away free to each customer if they add it to the cart. It seems that every item in the cart after the free item and including it disappears once they arrive at paypal.
Moving this to Bug Reports for treatment.
You can probably resolve this by making the following code substitutions:
/includes/modules/payment/paypal/paypal_functions.php, around line 762 replace this:
Code:
// loop thru all products to prepare details of quantity and price.
for ($i=0, $n=sizeof($order->products), $k=1; $i<$n; $i++, $k++) {
// PayPal won't accept zero-value line-items, so skip this entry if price is zero
if ($order->products[$i]['final_price'] == 0) continue;
with this:
Code:
// loop thru all products to prepare details of quantity and price.
for ($i=0, $n=sizeof($order->products), $k=1; $i<$n; $i++) {
// PayPal is inconsistent in how it handles zero-value line-items, so skip this entry if price is zero
if ($order->products[$i]['final_price'] == 0) {
continue;
} else {
$k++;
}
and
/includes/modules/payment/paypalwpp.php, around line 1158:
/includes/modules/payment/paypaldp.php, around line 1495:
Code:
// loop thru all products to prepare details of quantity and price.
for ($i=0, $n=sizeof($order->products), $k=0; $i<$n; $i++, $k++) {
// PayPal won't accept zero-value line-items, so skip this entry if price is zero
if ($order->products[$i]['final_price'] == 0) continue;
with
Code:
// loop thru all products to prepare details of quantity and price.
for ($i=0, $n=sizeof($order->products), $k=0; $i<$n; $i++) {
// PayPal is inconsistent in how it handles zero-value line-items, so skip this entry if price is zero
if ($order->products[$i]['final_price'] == 0) {
continue;
} else {
$k++;
}
NOTE: while there are lots of similarities between these, DO NOT MIX THEM UP! Those 0 and 1 differences are intentional.
Bookmarks