amareshray Posted May 31, 2011 Share Posted May 31, 2011 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 More sharing options...
amareshray Posted June 1, 2011 Author Share Posted June 1, 2011 Anyone? Thanks! Link to comment Share on other sites More sharing options...
multimixer Posted June 1, 2011 Share Posted June 1, 2011 file includes/classes/order.php is building an array of products This is used in checkout_process.php to update the database. While this is done you could also fill your variable My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
amareshray Posted June 1, 2011 Author Share Posted June 1, 2011 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 More sharing options...
multimixer Posted June 1, 2011 Share Posted June 1, 2011 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? My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
amareshray Posted June 2, 2011 Author Share Posted June 2, 2011 Thanks, that worked! However, it also puts the currency after the price, would there be a way of removing the currency symbol? Link to comment Share on other sites More sharing options...
multimixer Posted June 2, 2011 Share Posted June 2, 2011 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']) My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
amareshray Posted June 2, 2011 Author Share Posted June 2, 2011 Ok, replacing display_price with calculate_price fixed the issue! Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.