Page 1 of 1

Shopping Cart Session to keep track of distinct items

Posted: Tue Oct 10, 2006 9:36 am
by fitchic77
Each item needs to be distinct due to size and quantity and Product ID. Is there a better way to store a distinct set of data. Right now I'm concatinating the below information (product id, size and quantity) and parsing them out later.

Code: Select all

$_SESSION['products']["idProduct_".$id."_size|".$size . "_qty:" .$qty]  =  $id; //new entry
thanks,
Andrea

Posted: Tue Oct 10, 2006 9:42 am
by feyd
Your closing

Code: Select all

tag was an opening one.

Code: Select all

...

Code: Select all

$_SESSION['products'][] = array('id' => $id, 'size' => $size, 'qty' => $qty);