Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Built-in Shipping and Payment Modules / Got shopping cart items to show in PayPal IPN

Got shopping cart items to show in PayPal IPN

Locked

Started by bigbadbob on 14 Jul 2009, 11:37 PM · Views: 2,251

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
14 Jul 2009, 11:37 PM
#1
bigbadbob avatar

bigbadbob

New Zenner

Join Date:
Feb 2008
Location:
by Nuremberg Germany
Posts:
52
Plugin Contributions:
0

Got shopping cart items to show in PayPal IPN

Well, folks I think I finally figured out the age long problem of the shopping cart items not showing up in PayPal when using the PayPal IPN module (I am using Zen Cart 1.3.8a just in case it matters). Oddly enough, even the core designers of ZC said it couldn't be done. Or maybe my "hack" is screwing up the system, which I am sure I will hear from our master Sensei.

In looking at the paypal.php file it IS set up to transfer all the cart data to PayPal but there was a IF statement stopping it from happening with IPN.

Go to:
includes/modules/payment/paypal.php

Line 241 is:
if (MODULE_PAYMENT_PAYPAL_DETAILED_CART == 'Yes') $optionsLineItems = ipn_getLineItemDetails();

Delete the:
if (MODULE_PAYMENT_PAYPAL_DETAILED_CART == 'Yes')

So it only reads:
$optionsLineItems = ipn_getLineItemDetails();

Seems like that IF statement was there when there was an option in the PayPal IPN payment module to "send a detailed cart" to PayPal, which isn't an option anymore (or was it ever??).

PLEASE, make a backup of the file before you change it because this is not going in an override folder. Also, this is just for the PayPal IPN module but I just did the change on two sites and both work great. One is using the FEC (Fast & Easy Checkout) module and the other is using the COWOA (Checkout without account) module. I only hope this will work for others but who knows if it has any conflicts with other mods, etc.

One problem I found is with the Optional Insurance module. Seems like since PayPal does not have a field for optional insurance it throws the system an error and defaults it to the old way (showing only the total order and "store receipt") if somebody selects it or you have it set as mandatory. So it looks like the optional insurance is going to have to go in lieu of the benefit of having the shopping cart items show in PayPal.

If anybody has a cool idea on how to get the Insurance values over to PayPal, please let me know. Even if they got "combined to one value" in the shipping total on the checkout confirmation page would work for me!

15 Jul 2009, 3:17 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Got shopping cart items to show in PayPal IPN

You should consider that hack highly experimental.
There were MANY good reasons why the code was written that way ... because the content produced by that method is not fully reliable in v1.3.8 or earlier.
USE AT YOUR OWN RISK.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Jul 2009, 4:47 AM
#3
bigbadbob avatar

bigbadbob

New Zenner

Join Date:
Feb 2008
Location:
by Nuremberg Germany
Posts:
52
Plugin Contributions:
0

Re: Got shopping cart items to show in PayPal IPN

Yes, this is a HACK everybody so be highly aware! Although I haven't found ONE reason yet why the code was written that way and not in a manner that PP will get the ZC data with the IPN. Or any potential danger it could cause.

I gave up waiting on a 2.0 ZC release so I guess we will all just need to Hack away to have the current system do what it should be doing.

4 Aug 2009, 4:37 AM
#4
gklein avatar

gklein

New Zenner

Join Date:
Aug 2009
Posts:
1
Plugin Contributions:
0

Re: Got shopping cart items to show in PayPal IPN

When I tried this it worked . It did transfer items into paypal. However, the page directly before the paypal page shows error statements:

Notice: Undefined property: queryFactoryResult::$fields in /home/irgreatc/public_html/mycart/includes/functions/banner.php on line 136

Notice: Undefined property: queryFactoryResult::$fields in /home/irgreatc/public_html/mycart/includes/functions/banner.php on line 139

Notice: Undefined property: queryFactoryResult::$fields in /home/irgreatc/public_html/mycart/includes/functions/banner.php on line 140

Notice: Undefined property: queryFactoryResult::$fields in /home/irgreatc/public_html/mycart/includes/functions/banner.php on line 140

Notice: Undefined property: queryFactoryResult::$fields in /home/irgreatc/public_html/mycart/includes/functions/banner.php on line 150

4 Aug 2009, 8:52 PM
#5
bigbadbob avatar

bigbadbob

New Zenner

Join Date:
Feb 2008
Location:
by Nuremberg Germany
Posts:
52
Plugin Contributions:
0

Re: Got shopping cart items to show in PayPal IPN

Hum, weird it is giving an error for a Banner page. Should have nothing to do with Paypal. Sorry I can't help on that one.