genesisoa Posted March 25, 2007 Share Posted March 25, 2007 hi all just wondering if there is anyone out there who can help me with a problem im having. i have osCommerce 2.2-MS2 which i have started to customize to suit my needs. what i need to know is how to read session data Here is some session data i pulled from the table. (my sessions get saved to the sessions sql table) cart|cart|O:12:"shoppingCart":5:{s:8:"contents";a:2:{i:1201;a:1:{s:3:"qty";i:1;}i:1202;a:1:{s:3:"qty";i:1;}}s:5:"total";d:58.5;s:6:"weight";d:3;s:6:"cartID";s:5:"74587";s:12:"content_type";b:0;} inventory_id|s:6:"2:5,11"; language|s:7:"english"; languages_id|s:1:"1"; currency|s:3:"AUD"; navigation|O:17:"navigationHistory":2:{s:4:"path";a:2:{i:0;a:4:{s:4:"page";s:9:"index.php";s:4:"mode";s:6:"NONSSL";s:3:"get";a:1:{s:6:"osCsid";s:26:"grhdsjir0bm20adva88qha2g41";}s:4:"post";a:0:{}}i:1;a:4:{s:4:"page";s:16:"product_info.php";s:4:"mode";s:6:"NONSSL";s:3:"get";a:2:{s:11:"products_id";s:4:"1202";s:6:"osCsid";s:26:"grhdsjir0bm20adva88qha2g41";}s:4:"post";a:0:{}}}s:8:"snapshot";a:0:{}} ok what i need to know is how to extract the info out of the green line (cart variable). when i recall variables from inventory_id i use $_SESSION[inventory_id] and that gives me the values of '2:5,11' which is what i want but when i use $_SESSION[cart] i get Object id #1 as the return. im confused as the cart variable has heeps of extras i dont understand. i can see the figures i want but dont know how to recall them (ie 1201,1202=product_id, 1=qty, 3= weight, 58.5=total) could someone please explain to me in plain english how to do this. cheers jon. :rolleyes: Link to comment Share on other sites More sharing options...
genesisoa Posted March 25, 2007 Author Share Posted March 25, 2007 my mistake the green line is actually cart|O:12:"shoppingCart":5:{s:8:"contents";a:2:{i:1201;a:1:{s:3:"qty";i:1;}i:1202;a:1:{s:3:"qty";i:1;}}s:5:"total";d:58.5;s:6:"weight";d:3;s:6:"cartID";s:5:"74587";s:12:"content_type";b:0;} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.