Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Storing basket details in a single variable


amareshray

Recommended Posts

Hi guys,

 

Trying to integrate an affiliate network tracking code with my osCommerce installation, and I'm currently figuring out how to store the details of the shopping basket in a variable (say myItems) placed on checkout_success.php.

 

For instance, I would like the output to look like myItems=ProductPrice::ProductName::ProductID|Product2Price::Product2Name::Product2ID

 

Is there a way this could be done?

 

Thanks in advance,

Amaresh

Link to comment
Share on other sites

Thanks, would something like this work?

 

 

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

$myItems . = $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . "::" . $order->products[$i]['name'] . "::" . $order->products[$i]['id'] . "::" . "|";

Link to comment
Share on other sites

Take a look at classes/order.php to see what the array contain

 

If you need all that stuff you can use it as is, just call the class wherever you need it and that's it. If you need just some, then I would build a new array with just the items needed. Do you need this "|" etc for a specific reason?

Link to comment
Share on other sites

Thanks, that worked! However, it also puts the currency after the price, would there be a way of removing the currency symbol?

 

It does so because you said so: $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty'])

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...