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

I install Computer Accessories Magento Theme 58509 have some issues,thank your for me resolved this install problem.

--- Jodku

Estou clientes antigos, e depois os meus pontos de desconto ah, seu produto é realmente bom, eu gosto.

--- Pudlie

Ihre Vorlage Preis ist sehr erschwinglich, hohe Qualität und wir immer Lob der Chef, ich hoffe, eine langfristige Zusammenarbeit.Laughing

--- Daliyi

Professional verkkosivuilla malleja Ah, kyllä​​, ostin että ajaa hyvin, auttaa lisäämään myyntiä!

--- Jldier

Comprei um modelo de site que está funcionando muito estável, me ajudar a aumentar as vendas! Obrigado.

--- JACK JOM

I very like your templates,they are very pretty and professional designs!

--- Eendj

 

 

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