Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

cart contents


endanagle

Recommended Posts

Posted

hope you can all help me on this...

 

looking for some help please, i have several osCommerce installations up and running for different applications - all 'heavily' customised for my own requirements.

 

at the moment, I'm looking to extract the contents of a persons cart and show them on a page without using the shopping cart module, as the products are to go into a textarea. I have the osCsid and can retrieve the contents of the sessions table for that session with the product details intact, but was hoping there was another solution to save me trying to parse the info which comes out of the db in this format:

 

cart|O:12:"shoppingcart":5:{s:8:"contents";a:1:{i:537;a:1:{s:3:"qty";i:1;}}s:5:"total";d:
49;s:6:"weight";d:0;s:6:"cartID";s:5:"35768";s:12:"content_type";b:0;}language|s:7:"english";
languages_id|s:1:"1";currency|s:3:"EUR";navigation|O:17:"navigationhistory":2:{s:4:"path";a:2:
{i:0;a:4:{s:4:"page";s:11:"finance.php";s:4:"mode";s:6:"NONSSL";s:3:"get";a:0:{}s:4:"post";a:
0:{}}i:1;a:4:{s:4:"page";s:17:"shopping_cart.php";s:4:"mode";s:6:"NONSSL";s:3:"get";a:1:{s:
4:"sort";s:2:"3a";}s:4:"post";a:0:{}}}s:8:"snapshot";a:0:{}}new_products_id_in_cart|s:
3:"537";

 

Thanks for the help guys!

 

Regards

 

Enda

--

Posted

found it myself with 'tinkering'

 

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

$pList .= "" . $products[$i]['quantity'] . " x " . $products[$i]['name'] . "\r";

}

 

just displays the products without the headers or anything about extras for the product options etc.

 

hope it helps someone out!

Archived

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

×
×
  • Create New...