Forums / Built-in Shipping and Payment Modules / PayPal Website Payments Standard - Problem with product names

PayPal Website Payments Standard - Problem with product names

Views: 1,312

Results 1 to 8 of 8
16 Nov 2012, 6:56 PM
#1
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

PayPal Website Payments Standard - Problem with product names

I have PayPal Website Payments Standard - IPN enabled.

ZC version 1.3.9h

I have the show item lines in PayPal enabled.

When directed to PayPal, The item titles are showing the Attribute Name and option instead of the Product name??

Is this normal or is something wrong here?

Thanks

Phil

Phil Rogers
A problem shared is a problem solved.

16 Nov 2012, 7:28 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PayPal Website Payments Standard - Problem with product names

Not sure with IPN
But you should switch to the more robust and stable PayPalExpress module

Zen-Venom Get Bitten

16 Nov 2012, 9:55 PM
#3
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: PayPal Website Payments Standard - Problem with product names

It's only when there is an attribute assigned. Working otherwise.

Surely it's just calling the wrong info? Or maybe it's calling both and there is a character limit on PayPal?

Phil Rogers
A problem shared is a problem solved.

16 Nov 2012, 10:00 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PayPal Website Payments Standard - Problem with product names

Enable paypal logging in the admin setup
Make a couple of test purchases and check the logs
Post them here if you need assistance figuring them out

Zen-Venom Get Bitten

16 Nov 2012, 10:10 PM
#5
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: PayPal Website Payments Standard - Problem with product names

Ok cool will do, I'll have a look at the source code in the confirmation page too, hopefully should see the PayPal HTML form markup on there?

Phil Rogers
A problem shared is a problem solved.

16 Nov 2012, 11:01 PM
#6
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: PayPal Website Payments Standard - Problem with product names

think I have fixed it, though if someone can check the change I have made and let me know if there is any reason this will casue any problems.

In /includes/modules/payment/paypal/paypal_functions.php

I found this code:

      // if there are attributes, loop thru them and add to description
      if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
        $optionsLI["item_name_$k"] = '';
        for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
          $optionsLI["item_name_$k"] .= "\n " . $order->products[$i]['attributes'][$j]['option'] .
                                        ': ' . $order->products[$i]['attributes'][$j]['value'];

        } // end loop
      } // endif attribute-info

notice how the $optionsLI["item_name_$k"] = ''; is blank and not redefined anywhere after?

so I changed to this:

// if there are attributes, loop thru them and add to description
      if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
       // $optionsLI["item_name_$k"] = '';
          $optionsLI["item_name_$k"] = $order->products[$i]['name'];
        for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
         // $optionsLI["item_name_$k"] .= "\n " . $order->products[$i]['attributes'][$j]['option'] .
          //                              ': ' . $order->products[$i]['attributes'][$j]['value'];
            $optionsLI["item_name_$k"] .= ': ' . $order->products[$i]['attributes'][$j]['value'];

        } // end loop
      } // endif attribute-info

Look forward to hearing back, cheers

Phil

Phil Rogers
A problem shared is a problem solved.

17 Nov 2012, 12:18 AM
#7
drbyte avatar

drbyte

Sensei

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

Re: PayPal Website Payments Standard - Problem with product names

Based on what you said you wanted it to differently, yes that should work.

.
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.

17 Nov 2012, 8:36 AM
#8
philip937 avatar

philip937

Totally Zenned

Join Date:
Aug 2009
Location:
Bedford, England
Posts:
968
Plugin Contributions:
0

Re: PayPal Website Payments Standard - Problem with product names

DrByte:

Based on what you said you wanted it to differently, yes that should work.

Doc, so is it normal behaviour that when there are options that it only uses the option name and value as the item title? That's what the original code seems to be doing?

Glad what I've done is ok :)

Phil Rogers
A problem shared is a problem solved.