I have a weird problem where I want to store products from my shop in a session. This works well, except for some products. The shop is part of a cms where all products are rendered the same way. When someone adds a product to the shop this will be serialized and send with ajax to a script.
Almost all items are stored, but for some reason some items don't get stored. I can't find a connection or anything and I don't get any errors returned.
So this is the code that stores the product in a session:
$storeItemNumber = (string)$post['itemcode'];
$storeItem = array($storeItemNumber => array(
'title' => $post['title'],
'price' => $post['price'],
'quantity' => $post['quantity']
)
);
$shopSession->$storeItemNumber = $storeItem;
This is an example of a product that gets stored:
array('010101000' => array(
'title' => 'Product title - 15',
'price' => '28.95',
'quantity' => '1',
));
This is an example of a product that doesn't get stored:
array('400002001' => array(
'title' => 'Product title - Pink',
'price' => '5.50',
'quantity' => '1',
));
I already checked if the data gets through alright and it does right until the saving of it in a session.
What could possibly be a reason?