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

Ho seguito tutti i passi spiegati nella risposta, ma io non so come una patch per il database di Joomla con "source\dump.sql".

--- Maria Galisai

ok. Vielen Dank. Ich werde versuchen, es installieren und im Falle von Schwierigkeiten, wird für Ihre Hilfe zu bitten

--- Kortboyer

I purchased the 30083 LINGERIE template that i install easily, thanks to your video tutorial. Could tell me how to modify the "anything slider"?

--- M. Bouacheria

Eu já baixei o tema prestashop. Obrigado pela sua atenção! 

--- AMANCIO

Eu sou novo no Joomla, como faço para criar todos esses menus e posições, há um componente que eu tenho que instalar?

--- Nigel

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