Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

paypal again


Recommended Posts

What and how can I set up to let paypal get the ordered items?

I'm new in oscommmerce but right now I am in a big trouble.


cmd=_cart & new variable"upload" in paypal.php file & a for loop for item_name_[$i]=$order->products[]$i]['name'].bla-bla... should resolve my problem?

Is this the way they normaly get the ordered items?

Does Paypal need the ordered items just to notify the customer?

Thanks. :(

Link to comment
Share on other sites

I use the current snapshot and have no problem with Paypal payment module. The only thing I have to do in order to make it work properly is to check this option:

"allow transaction-based shipping values to override the profile shipping settings listed above (if profile settings are enabled)"


---This can be done in your Profile --> Shipping Calculation


Hope this help! :D

Link to comment
Share on other sites

Paypal has an example for developers.It show html hidden field named "upload" and changing values: 1,2,3...Each value ,means an item...like item_name_1 ,item_name_2...and so on?!?!

I don't know to implement this in paypal.php file but I think it is not imposible.

So one name and more values...Hmm...It seems to be like a <select><option> with multiple values...

I would be nice if paypal would be able to send back to me the ordered items too,isn't it? I will not have to check in admin...orders whatever the customer has ordered.

But first I'll try to do that setting in Profile Joyce(James?) recomanded me.


Thanks Frank.It helps me a lot.

I 'll let you know if I get something interesting :)

Link to comment
Share on other sites

Here is the solution about not knowing what customer ordered:Forum Topic


chfields Came up with the answer! :lol:


Just in case someone doesn't click continue to get back to your site

here is a mod to include into your PayPal module to you can see what the customer ordered on your PayPal payment notification (just in case they don't return to your site to complete the process and generate an invoice) -




change the following code:


function process_button() {

global $order, $currencies, $currency;


if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') {

$my_currency = $currency;

} else {

$my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5);


if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) {

$my_currency = 'USD';


$xx = '';

for ($i=0; $i<sizeof($order->products); $i++) {

$xx .= $order->products[$i]['qty'] . '-' . ($order->products[$i]['name']) . '**';


$process_button_string = tep_draw_hidden_field('cmd', '_xclick') .

tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) .

tep_draw_hidden_field('item_name', STORE_NAME . ' ' . $xx) .

tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .

tep_draw_hidden_field('shipping', 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('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .

tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));


return $process_button_string;




the above code snippet replaces the code snippet in the catalog/includes/modules/payment/paypal.php file


look for


function process_button() {


and then copy and paste and replace that section of code with the code above

Link to comment
Share on other sites


It is working.All ordered items are passed to paypal like a string.

I knew I have to add a for loop there.But not enough time for testing.

Thanks a lot Joyce. :)

You know,when I am in a hurry....and osc new for me...

Link to comment
Share on other sites

When you select as Payment Method ,Payapal IPN and send request to paypal server,you can see in url that cmd is set to _ext_enter.

I wander where is that setting set? Which file? :unsure:

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...