Zen Cart Logo
Forums / Bug Reports / [Done v1.5.0] PayPal IPN Missing free Items

[Done v1.5.0] PayPal IPN Missing free Items

Locked

Views: 1,445

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
29 May 2011, 2:49 AM
#1
usacanbag avatar

usacanbag

New Zenner

Join Date:
May 2011
Posts:
7
Plugin Contributions:
0

[Done v1.5.0] PayPal IPN Missing free Items

I am running Zen Cart 1.3.9h On godaddy. 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.
I would appreciate any help on this, my customers are leaving because it reflects poorly on our credibility.

Thanks in advance
KAZ from usacanbag.com

29 May 2011, 2:58 AM
#2
usacanbag avatar

usacanbag

New Zenner

Join Date:
May 2011
Posts:
7
Plugin Contributions:
0

Re: [Done v1.5.0] PayPal IPN Missing free Items

Update: I have turned line items of in paypal IPN and this seems to have corrected the issue with the total. But now I don't have line items in paypal for the customer to see.
Help please.

29 May 2011, 3:52 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.5.0] PayPal IPN Missing free Items

What happens if you use Express Checkout instead?

29 May 2011, 6:38 AM
#4
usacanbag avatar

usacanbag

New Zenner

Join Date:
May 2011
Posts:
7
Plugin Contributions:
0

Re: [Done v1.5.0] PayPal IPN Missing free Items

Thanks for the suggestion. Dr. Byte.
Well I switched over to paypal express and I still have the problem. In this case it seems there is a rounding error on the line item subtotals. Line items are still not displayed. The text of the log fallows.


getLineItemDetails 5
paypalwpp
Line-item subtotals do not add up properly. Line-item-details skipped.
72.03 0Array
(
[AMT] => 81.21
[ITEMAMT] => 72.03
[TAXAMT] => 0
[SHIPPINGAMT] => 9.18
[SHIPDISCAMT] => 0
[HANDLINGAMT] => 0
[INSURANCEAMT] => 0
[L_NUMBER0] => 32FSGSL
[L_NAME0] => 2 1/2 qt CanBag - 25 Pack
[L_AMT0] => 16.65
[L_QTY0] => 1
[L_NUMBER1] => 2EASAMPLE
[L_NAME1] => Sample Pack
[L_AMT1] => 19.611
[L_QTY1] => 1
[L_NUMBER2] => 80FSGSL
[L_NAME2] => 1 1/2 Gallon CanBag - 25 Pack
[L_AMT2] => 30.375
[L_QTY2] => 1
[L_NUMBER4] => 21400
[L_NAME4] => Ball Blue Book
[L_AMT4] => 5.39
[L_QTY4] => 1
[L_NAME3] =>
)

The sub total is actually $72.026
the odd amounts are due to a sale.

I have some coding skills if someone could point me in the right direction.

29 May 2011, 6:53 AM
#5
usacanbag avatar

usacanbag

New Zenner

Join Date:
May 2011
Posts:
7
Plugin Contributions:
0

Re: [Done v1.5.0] PayPal IPN Missing free Items

Oh forgot to mention. After testing the free items in the cart only show up with no description. Just says "item price $0.00"

5 Jun 2011, 8:57 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: [Done v1.5.0] PayPal IPN Missing free Items

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:// 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:```
// 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:```
    // 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```
    // 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.