Simple Static Basket with session storage

Basket (empty) [emptyBasket, getItemList]
NULL
Full price: 0
Item quantity:
Item types: 0
Last modify: 1970-01-01 01:00:00 ()
>> Wait 1 seconds for testing.


Add a simple item [changeItem]
array ( 'sugar_01' => array ( 'quantity' => 12.25, 'name' => 'Sugar, 1kg', 'price' => 0.75, ), )
Full price: 9.1875
Item quantity: 12.25
Item types: 1
Last modify: 2015-08-02 12:14:24 (1438510464)
>> Wait 3 seconds for testing.


Add multiple items [addItemFromArray]
array ( 'sugar_01' => array ( 'quantity' => 12.25, 'name' => 'Sugar, 1kg', 'price' => 0.75, ), 'salt_01' => array ( 'quantity' => 4.57000000000000028421709430404007434844970703125, 'name' => 'Salt, 1kg', 'price' => 0.65000000000000002220446049250313080847263336181640625, ), 'salt_02' => array ( 'quantity' => 3.100000000000000088817841970012523233890533447265625, 'name' => 'Salt, 2kg', 'price' => 1.149999999999999911182158029987476766109466552734375, ), 'salt_03' => array ( 'quantity' => 2.899999999999999911182158029987476766109466552734375, 'name' => 'Salt, 5kg', 'price' => 2.54999999999999982236431605997495353221893310546875, ), 'sugar_02' => array ( 'quantity' => 1.3400000000000000799360577730112709105014801025390625, 'name' => 'Sugar, 2kg', 'price' => 1.399999999999999911182158029987476766109466552734375, ), 'sugar_03' => array ( 'quantity' => 13.449999999999999289457264239899814128875732421875, 'name' => 'Sugar, 5kg', 'price' => 3.589999999999999857891452847979962825775146484375, ), )
Full price: 73.2795
Item quantity: 37.61
Item types: 6
Last modify: 2015-08-02 12:14:27 (1438510467)
>> Wait 3 seconds for testing.


Remove salt_03 [removeItem]
array ( 'sugar_01' => array ( 'quantity' => 12.25, 'name' => 'Sugar, 1kg', 'price' => 0.75, ), 'salt_01' => array ( 'quantity' => 4.57000000000000028421709430404007434844970703125, 'name' => 'Salt, 1kg', 'price' => 0.65000000000000002220446049250313080847263336181640625, ), 'salt_02' => array ( 'quantity' => 3.100000000000000088817841970012523233890533447265625, 'name' => 'Salt, 2kg', 'price' => 1.149999999999999911182158029987476766109466552734375, ), 'sugar_02' => array ( 'quantity' => 1.3400000000000000799360577730112709105014801025390625, 'name' => 'Sugar, 2kg', 'price' => 1.399999999999999911182158029987476766109466552734375, ), 'sugar_03' => array ( 'quantity' => 13.449999999999999289457264239899814128875732421875, 'name' => 'Sugar, 5kg', 'price' => 3.589999999999999857891452847979962825775146484375, ), )
Full price: 65.8845
Item quantity: 34.71
Item types: 5
Last modify: 2015-08-02 12:14:30 (1438510470)
>> Wait 2 seconds for testing.


Change the quantity of salt_02 to 3.45 [changeItem]
array ( 'sugar_01' => array ( 'quantity' => 12.25, 'name' => 'Sugar, 1kg', 'price' => 0.75, ), 'salt_01' => array ( 'quantity' => 4.57000000000000028421709430404007434844970703125, 'name' => 'Salt, 1kg', 'price' => 0.65000000000000002220446049250313080847263336181640625, ), 'salt_02' => array ( 'quantity' => 3.45000000000000017763568394002504646778106689453125, 'name' => 'Salt, 2kg', 'price' => 1.149999999999999911182158029987476766109466552734375, ), 'sugar_02' => array ( 'quantity' => 1.3400000000000000799360577730112709105014801025390625, 'name' => 'Sugar, 2kg', 'price' => 1.399999999999999911182158029987476766109466552734375, ), 'sugar_03' => array ( 'quantity' => 13.449999999999999289457264239899814128875732421875, 'name' => 'Sugar, 5kg', 'price' => 3.589999999999999857891452847979962825775146484375, ), )
Full price: 66.287
Item quantity: 38.16
Item types: 5
Last modify: 2015-08-02 12:14:32 (1438510472)
>> Wait 2 seconds for testing.


Change the price of salt_02 to 1.23 [changeItem]
array ( 'sugar_01' => array ( 'quantity' => 12.25, 'name' => 'Sugar, 1kg', 'price' => 0.75, ), 'salt_01' => array ( 'quantity' => 4.57000000000000028421709430404007434844970703125, 'name' => 'Salt, 1kg', 'price' => 0.65000000000000002220446049250313080847263336181640625, ), 'salt_02' => array ( 'quantity' => 3.45000000000000017763568394002504646778106689453125, 'name' => 'Salt, 2kg', 'price' => 1.229999999999999982236431605997495353221893310546875, ), 'sugar_02' => array ( 'quantity' => 1.3400000000000000799360577730112709105014801025390625, 'name' => 'Sugar, 2kg', 'price' => 1.399999999999999911182158029987476766109466552734375, ), 'sugar_03' => array ( 'quantity' => 13.449999999999999289457264239899814128875732421875, 'name' => 'Sugar, 5kg', 'price' => 3.589999999999999857891452847979962825775146484375, ), )
Full price: 66.563
Item quantity: 38.16
Item types: 5
Last modify: 2015-08-02 12:14:32 (1438510472)
>> Wait 2 seconds for testing.


Change the name of salt_02 to Sugar, 1.5kg [changeItem]
array ( 'sugar_01' => array ( 'quantity' => 12.25, 'name' => 'Sugar, 1kg', 'price' => 0.75, ), 'salt_01' => array ( 'quantity' => 4.57000000000000028421709430404007434844970703125, 'name' => 'Salt, 1kg', 'price' => 0.65000000000000002220446049250313080847263336181640625, ), 'salt_02' => array ( 'quantity' => 3.45000000000000017763568394002504646778106689453125, 'name' => 'Sugar, 1.5kg', 'price' => 1.229999999999999982236431605997495353221893310546875, ), 'sugar_02' => array ( 'quantity' => 1.3400000000000000799360577730112709105014801025390625, 'name' => 'Sugar, 2kg', 'price' => 1.399999999999999911182158029987476766109466552734375, ), 'sugar_03' => array ( 'quantity' => 13.449999999999999289457264239899814128875732421875, 'name' => 'Sugar, 5kg', 'price' => 3.589999999999999857891452847979962825775146484375, ), )
Full price: 66.563
Item quantity: 38.16
Item types: 5
Last modify: 2015-08-02 12:14:32 (1438510472)
>> Wait 1 seconds for testing.