Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

have problem passing options to payment processor


nana

Recommended Posts

hello

i wonder if domeone can help me with this

this piece of code passes options to my pay processor

for ($j=0, $n2=1 $j<$n2; $j++) {

$process_button_string .= 'on'.$j.'_'.$x.'='.urlencode($order->products[$i]['attributes'][$j]['option']) .'&'.

'os'.$j.'_'.$x.'='.$order->products[$i]['attributes'][$j]['value'] .'&';

        }

i have more options i need the code that get all of the options and make one long option like "red*large*longsleeve" and pass it as one option

Link to comment
Share on other sites

ok

i tried to do something but it does not pass the attributes i must be doing something wrong if someone can figure it out

$process_button_string ='?';

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

$x=$i+1;

$process_button_string .=

'item_name_'.$x.'='.urlencode($order->products[$i]['name']) .'&'.

'quantity_'.$x.'='.$order->products[$i]['qty'] .'&'.

'amount_'.$x.'='.$currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'],1) .'&'.

'shipping_'.$x.'='.number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency)).'&';


/////// i have made changes from here
  if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
    $xx = '';

    for ($j=0,  $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
  $xx=$xx.$order->products[$i]['attributes'][$j]['value'] . '**';
     }
      $process_button_string .=
'on'.'1'.'_'.$x.'='.''.'&'.

'os'.'1'.'_'.$x.'='.$xx .'&';



     }
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...