osCommerce Templates | Magento Themes | Free osCommerce Themes - eCommerce Engine

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

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 .

Comments

Мне нравится этот VirtueMart шаблона. Спасибо.

--- Vladimir

Здравствуйте, Как изменить вспышки в этой PrestaShop тему? 

--- Nikita Khruschev

Hvala, ker ste mi pomagali, da namestite Magento predlogo.Smile

--- Andrecjek

Vielen Dank für Ihre Unterstützung. Nun ist diese Vorlage auf Magento 1.4.2 funktionieren. Laughing

--- Raman

Ai aceeaşi temă pentru PrestaShop? Pentru că am un alt magazin online care are nevoie.

--- Martin

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