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 2 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: 2014-10-24 10:28:14 (1414139294)
>> 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.57, 'name' => 'Salt, 1kg', 'price' => 0.65, ), 'salt_02' => array ( 'quantity' => 3.1, 'name' => 'Salt, 2kg', 'price' => 1.15, ), 'salt_03' => array ( 'quantity' => 2.9, 'name' => 'Salt, 5kg', 'price' => 2.55, ), 'sugar_02' => array ( 'quantity' => 1.34, 'name' => 'Sugar, 2kg', 'price' => 1.4, ), 'sugar_03' => array ( 'quantity' => 13.45, 'name' => 'Sugar, 5kg', 'price' => 3.59, ), )
Full price: 73.2795
Item quantity: 37.61
Item types: 6
Last modify: 2014-10-24 10:28:17 (1414139297)
>> Wait 2 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.57, 'name' => 'Salt, 1kg', 'price' => 0.65, ), 'salt_02' => array ( 'quantity' => 3.1, 'name' => 'Salt, 2kg', 'price' => 1.15, ), 'sugar_02' => array ( 'quantity' => 1.34, 'name' => 'Sugar, 2kg', 'price' => 1.4, ), 'sugar_03' => array ( 'quantity' => 13.45, 'name' => 'Sugar, 5kg', 'price' => 3.59, ), )
Full price: 65.8845
Item quantity: 34.71
Item types: 5
Last modify: 2014-10-24 10:28:19 (1414139299)
>> Wait 1 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.57, 'name' => 'Salt, 1kg', 'price' => 0.65, ), 'salt_02' => array ( 'quantity' => 3.45, 'name' => 'Salt, 2kg', 'price' => 1.15, ), 'sugar_02' => array ( 'quantity' => 1.34, 'name' => 'Sugar, 2kg', 'price' => 1.4, ), 'sugar_03' => array ( 'quantity' => 13.45, 'name' => 'Sugar, 5kg', 'price' => 3.59, ), )
Full price: 66.287
Item quantity: 38.16
Item types: 5
Last modify: 2014-10-24 10:28:20 (1414139300)
>> Wait 1 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.57, 'name' => 'Salt, 1kg', 'price' => 0.65, ), 'salt_02' => array ( 'quantity' => 3.45, 'name' => 'Salt, 2kg', 'price' => 1.23, ), 'sugar_02' => array ( 'quantity' => 1.34, 'name' => 'Sugar, 2kg', 'price' => 1.4, ), 'sugar_03' => array ( 'quantity' => 13.45, 'name' => 'Sugar, 5kg', 'price' => 3.59, ), )
Full price: 66.563
Item quantity: 38.16
Item types: 5
Last modify: 2014-10-24 10:28:20 (1414139300)
>> Wait 3 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.57, 'name' => 'Salt, 1kg', 'price' => 0.65, ), 'salt_02' => array ( 'quantity' => 3.45, 'name' => 'Sugar, 1.5kg', 'price' => 1.23, ), 'sugar_02' => array ( 'quantity' => 1.34, 'name' => 'Sugar, 2kg', 'price' => 1.4, ), 'sugar_03' => array ( 'quantity' => 13.45, 'name' => 'Sugar, 5kg', 'price' => 3.59, ), )
Full price: 66.563
Item quantity: 38.16
Item types: 5
Last modify: 2014-10-24 10:28:20 (1414139300)
>> Wait 1 seconds for testing.