Originally Posted 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?
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':
Code:
$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
Code:
$optionsLI["L_PAYMENTREQUEST_0_NUMBER$k"] = $order->products[$i]['model'];
//-bof-site-specific change: Removing products_id suffix.
// $optionsLI["L_PAYMENTREQUEST_0_NAME$k"] = $order->products[$i]['name'] . ' [' . (int)$order->products[$i]['id'] . ']';
$optionsLI["L_PAYMENTREQUEST_0_NAME$k"] = $order->products[$i]['name'];
//-eof-site-specific change
// 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
Bookmarks