Well, I got stuck with editing someone elses code after they dropped off a project and I can't figure out how to do this. This is part of a shopping cart system that allows multiple products and quantities.
The original serialized array in mysql looks like this:
a:3:{s:5:"owned";i:1;s:6:"leased";i:0;s:7:"install";i:0;}
In the 2checkout call back script it get's unserialized
$order['products'] = unserialize($order['products']);
then
$count = 0;
for ($i = 0; $i < ($order['products']['owned'] + $order['products']['leased']); $i ++) {
$count ++;
then it's read and inserted into the database:
$license['customerid'] = $customer['customerid'];
$license['type' ] = ($count > $order['products']['owned']) ? ('leased') : ('owned');
$license['status' ] = 1;
$license['purchase' ] = time();
$DB->insert($license, 'license');
but here is my issue. I manually added additional products so now the serialized mysql bit looks like this:
a:4:{s:5:"owned";i:0;s:6:"leased";i:1;s:7:"product";i:0;s:7:"install";i:0;}
What do I need to change to the $count strings to let it choose this new item if it's greater than 0?
Thanks for any help.