Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Paypal Item Description Display if Aggregate


thelookingglass

Recommended Posts

Posted

Hi,

 

After spending some time on setting up Paypal, I decided to opt for the Aggregate shopping cart method as when I use discounts, the Itemised shopping cart method screws up the totals.

 

Anyway, problem I am trying to fix, is when the information transfers over to payal, as it does not display items separately, which I understand, it shows my store name and then the description of the first item if it is a multiple order.

 

I have seen with some paypal screen shots it displaying the description as , eg. 3 Items.

 

How do I change it so it does not just show the first item description, but says something like number of items purchased.

 

I do not want to change to Itemised shopping cart, as problem with discount totals not transferring through.

 

Hope this makes sense to somebody.

 

Thanks - Sue

Posted

Hi again,

 

I've added the section below on shopping cart options from includes/modules/payment/paypal.php which might help.

 

//Shopping Cart Info

if(MODULE_PAYMENT_PAYPAL_METHOD == 'Itemized') {

 

$paypal_fields .= tep_draw_hidden_field('upload', sizeof($order->products)) .

tep_draw_hidden_field('redirect_cmd', '_cart') .

tep_draw_hidden_field('handling_cart', number_format($order->info['shipping_cost'] * $my_currency_value, $currencies->get_decimal_places($my_currency)));

 

//Itemized Order Details

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

//$index = $i+1;

$paypal_fields .= tep_draw_hidden_field('item_name_'.$index, $order->products[$i]['name']).

tep_draw_hidden_field('item_number_'.$index, $order->products[$i]['model']).

tep_draw_hidden_field('quantity_'.$index, $order->products[$i]['qty']).

tep_draw_hidden_field('amount_'.$index, number_format($order->products[$i]['final_price']* $my_currency_value,2));

$tax = ($order->products[$i]['final_price'] * ($order->products[$i]['tax'] / 100)) * $my_currency_value;

$paypal_fields .= tep_draw_hidden_field('tax_'.$index, number_format($tax, 2));

 

//Customer Specified Product Options: PayPal Max = 2

if ($order->products[$i]['attributes']) {

//$n = sizeof($order->products[$i]['attributes']);

for ($j=0; $j<2; $j++) {

if($order->products[$i]['attributes'][$j]['option']){

$paypal_fields .= $this->optionSetFields($j,$index,$order->products[$i]['attributes'][$j]['option'],$order->products[$i]['attributes'][$j]['value']);

} else {

$paypal_fields .= $this->optionSetFields($j,$index);

}

}

} else {

for ($j=0; $j<2; $j++) {

$paypal_fields .= $this->optionSetFields($j,$index);

}

}

}

 

} else { //Aggregate Cart (Method 1)

 

$paypal_fields .= tep_draw_hidden_field('item_name', STORE_NAME) .

tep_draw_hidden_field('redirect_cmd', '_xclick') .

tep_draw_hidden_field('amount', !empty($payment_amount) ? $payment_amount : $this->amount($my_currency)) .

tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $my_currency_value, $currencies->get_decimal_places($my_currency)));

$item_number = '';

for ($i=0; $i<sizeof($order->products); $i++) $item_number .= ' '.$order->products[$i]['name'].' ,';

$item_number = substr_replace($item_number,'',-2);

$paypal_fields .= tep_draw_hidden_field('item_number', $item_number);

 

}

 

Thanks again

Archived

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

×
×
  • Create New...