If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / PayPal Express Checkout support / Product id appended to product name on paypal page

Product id appended to product name on paypal page

Locked

Started by ebaobao on 3 May 2013, 5:25 AM · Views: 59,405

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
3 May 2013, 5:25 AM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Post #1 by ebaobao

Hello,

When a user adds an item to cart and then does a paypal express checkout, they are redirected to paypal's page listing the product like this:

SAMPLE 6 [185]
Item number: 1616
Item price: $10.00
Quantity: 1

Notice how the product id "185" is next to the name. However since there is also an item number: 1616, isn't it confusing to have both? Is there a way to remove product id there? What would be the best solution to handle this? In my opinion, if the product id wasn't there, then it would look perfect, is this possible?

3 May 2013, 5:29 AM
#2
drbyte avatar

drbyte

Sensei

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

Post #2 by drbyte

The product id is there to differentiate in case you've got multiple items of the same name. Many stores have the same name in multiple configurations, and this is important to help track back to which actual item was really purchased.

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

4 May 2013, 4:38 AM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Post #3 by ebaobao

Ok that makes sense. I guess I'll just put the model number the same as its product id for consistency purposes. Thanks for the reply drbyte.

30 Apr 2022, 9:15 PM
#4
alexthedude avatar

alexthedude

New Zenner

Join Date:
Apr 2022
Posts:
9
Plugin Contributions:
0

Post #4 by alexthedude

I realize this topic is nearly a decade old however it is still relevant today. I recently purchased a business and its website runs on Zen Cart v1.5.7d. I noticed that the product id is appended to the product name in PayPal.

My website has unique names for all items and it will always have unique names for all items, so I do not want the product id appended to the product name in PayPal.

I found some code in some payment files that I thought may be causing the product id to append the product name, however, when I edited the code and ran test transactions the id was still after the product name in PayPal.

I am sure that I could figure this out on my own however it may take many hours to do so, so I am wondering if anyone here knows which file to edit and what to edit in the file?

1 May 2022, 2:52 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,146
Plugin Contributions:
56

Post #5 by lat9

AlexTheDude:

I realize this topic is nearly a decade old however it is still relevant today. I recently purchased a business and its website runs on Zen Cart v1.5.7d. I noticed that the product id is appended to the product name in PayPal.

My website has unique names for all items and it will always have unique names for all items, so I do not want the product id appended to the product name in PayPal.

I found some code in some payment files that I thought may be causing the product id to append the product name, however, when I edited the code and ran test transactions the id was still after the product name in PayPal.

I am sure that I could figure this out on my own however it may take many hours to do so, so I am wondering if anyone here knows which file to edit and what to edit in the file?
Since you didn't indicate which variant of PayPal is being used, I'm guessing paypalwpp (PayPal Express Checkout). If that's the case, edit /includes/modules/payment/paypalwpp.php, finding this 'chunk':

      $optionsLI["L_PAYMENTREQUEST_0_NUMBER$k"] = $order->products[$i]['model'];
      $optionsLI["L_PAYMENTREQUEST_0_NAME$k"]   = $order->products[$i]['name'] . ' [' . (int)$order->products[$i]['id'] . ']';
      // Append *** if out-of-stock.
      $optionsLI["L_PAYMENTREQUEST_0_NAME$k"]  .= ((zen_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty']) < 0 ? STOCK_MARK_PRODUCT_OUT_OF_STOCK : '');
      // if there are attributes, loop thru them and add to description
      if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
        for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
          $optionsLI["L_PAYMENTREQUEST_0_NAME$k"] .= "\n " . $order->products[$i]['attributes'][$j]['option'] .
                                        ': ' . $order->products[$i]['attributes'][$j]['value'];
        } // end loop
      } // endif attribute-info

... and changing to

      $optionsLI["L_PAYMENTREQUEST_0_NUMBER$k"] = $order->products[$i]['model'];
[B]//-bof-site-specific change: Removing products_id suffix.[/B]
[B]//[/B]      $optionsLI["L_PAYMENTREQUEST_0_NAME$k"]   = $order->products[$i]['name'] . ' [' . (int)$order->products[$i]['id'] . ']';
      [B]$optionsLI["L_PAYMENTREQUEST_0_NAME$k"]   = $order->products[$i]['name'];[/B]
[B]//-eof-site-specific change[/B]
      // Append *** if out-of-stock.
      $optionsLI["L_PAYMENTREQUEST_0_NAME$k"]  .= ((zen_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty']) < 0 ? STOCK_MARK_PRODUCT_OUT_OF_STOCK : '');
      // if there are attributes, loop thru them and add to description
      if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0 ) {
        for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
          $optionsLI["L_PAYMENTREQUEST_0_NAME$k"] .= "\n " . $order->products[$i]['attributes'][$j]['option'] .
                                        ': ' . $order->products[$i]['attributes'][$j]['value'];
        } // end loop
      } // endif attribute-info
1 May 2022, 7:57 PM
#6
alexthedude avatar

alexthedude

New Zenner

Join Date:
Apr 2022
Posts:
9
Plugin Contributions:
0

Post #6 by alexthedude

Thank you very much lat9.

I checked and my site is using PayPal Express Checkout. I made the change that you prescribed, ran an order and paid for it with PayPal, and it works perfectly with no more product id on the PayPal payment.

I had done the exact same coding change to the wrong file which is why it did not previously work when I tried it on my own. I previously changed the paypal.php file instead of the paypalwpp.php file.

I did not want to keep making and refunding PayPal payments between my own PayPal accounts fearing that it would trigger some sort of security warning with PayPal and get my accounts frozen or something like that, so that is why I asked for help here instead of keep trying on my own.

Anyways thank you so much for your help lat9, and being this is the first time that I have used the Zen Cart forum I am very impressed with it.

1 May 2022, 8:52 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,908
Plugin Contributions:
23

Post #7 by dbltoe

We'll treat you so many different ways, you're bound to like one of them! :P

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com