How to revise the osCommerce Paypal Payment module to show item name?

E-mail Print PDF

The PayPal payment module for osCommerce Templates does not send an item name to Paypal as a transaction is processed. The developer of this module programmed it to send the name of your store instead:

tep_draw_hidden_field('item_name', STORE_NAME) .


The result is that when the transaction completes, Paypal sends the store owner an email notification, unhelpfully describing the item purchased as "[name of your store]".


We will fix this by changing the code in the payment module to send a better description for that field. While we're at it, we'll change the code to better support stores selling multiple items in one transaction because this osCommerce Paypal payment module comes "out of the box" designed more for single item purchase. When multiple items are purchased, this module just gives an aggregate description of the whole transaction, without any detail of what exatly was purchased.


To fix both of these problems, use the patch file below, or edit (path to your store)/includes/modules/payment/paypal.php and jump down to this function: function process_button() {
find the line that looks like:


$process_button_string = tep_draw_hidden_field and insert a comment marker right before it:
$process_button_string = tep_draw_hidden_field


and then go down a few more lines from there until you get to the one that has a semicoloum at the end, instead of a period. After that line, insert an ending comment marker:

$process_button_string = tep_draw_hidden_field('cmd', '_cart') .
tep_draw_hidden_field('upload', '1') .
tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) .
tep_draw_hidden_field('handling_cart', number_format($order->info['shipping_cost']
$currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . tep_draw_hidden_field('currency_code', $my_currency) .
tep_draw_hidden_field('custom', $order->info['comments']) .
tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));


$i=0;
foreach($order->products as $key => $arr)
{
$i++;
$process_button_string .= tep_draw_hidden_field("item_name_$i", $arr["qty"] ." ". $arr["name"]) . tep_draw_hidden_field("amount_$i", $arr["qty"] * $arr["final_price"]); }


Save the file now .

Testimonials

Questo tema VirtueMart è molto buona. Sarà un nuovo acquisto.

--- Gina

Nem installation, professionelt design, tak for din Prestashop skabelon

--- Mads

Comment faire pour déplacer le module catégorie à un autre poste dans ce modèle de virtuemart? Smile

--- Eric

Kyllä, olen yrittänyt. Tämä Magento teema voi toimia version 2.0.x Kiitos. 

--- Teemu

Wydacie więcej oscommerce 2.3.4 szablonów??

--- Franciszka

Gracias por su respuesta rápida y ayudar con mi tema ZenCart.

--- Almunda

 
You are here: Tips and Tricks How to revise the osCommerce Paypal Payment module to show item name?