Cart - Cookie problem (size of cart) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Cart - Cookie problem (size of cart) (/showthread.php?tid=53229) |
Cart - Cookie problem (size of cart) - El Forum - 07-16-2012 [eluser]mallix[/eluser] I have implemented the Cart Class to support my project but I have problems with the size of it as we already know that a cookie is not supposed to be more than 4 Kb. Also I have my cookie encrypted so add the size of it too. My product looks like this: 'id' => 'product_id' 'qty' => 'quantity' 'price' => 'price' 'name' => 'product_name' 'options' => array( 'variation' => 'variation_id', 'components' => 'component_id1,component_id2...' ) Which is the way to implement the Cart Class avoiding the cookie limit when the Cart itself is using a cookie to function. For now I can only store 3 to 4 products with variations and components but what is the purpose of implementing a Cart Class in a CI project if somehow you can t have "unlimited" products in the cart. Thank you! Cart - Cookie problem (size of cart) - El Forum - 07-16-2012 [eluser]mallix[/eluser] Ok that is strange. Using ONLY Ids to keep track of the products in cart WITHOUT any options I get this from contents() : ({c4ca4238a0b923820dcc509a6f75849b:{rowid:"c4ca4238a0b923820dcc509a6f75849b", id:"1", qty:"1", price:"9.99", name:"1", subtotal:9.99}, c81e728d9d4c2f636f067f89cc14862c:{rowid:"c81e728d9d4c2f636f067f89cc14862c", id:"2", qty:"1", price:"9.99", name:"2", subtotal:9.99}, eccbc87e4b5ce2fe28308fd9f2a7baf3:{rowid:"eccbc87e4b5ce2fe28308fd9f2a7baf3", id:"3", qty:"1", price:"9.99", name:"3", subtotal:9.99}, a87ff679a2f3e71d9181a67b7542122c:{rowid:"a87ff679a2f3e71d9181a67b7542122c", id:"4", qty:"1", price:"9.99", name:"4", subtotal:9.99}}) I cannot add any other product to the cart probably due to cookie limitations but even if I used a database to track the options via the rowid.. A little help would be great as I can see that something is missing in the Cart Class .. Cart - Cookie problem (size of cart) - El Forum - 07-16-2012 [eluser]mallix[/eluser] Another questions that occurs. Is there a way for the cart to be the only feature using the database to store the options rather than CI sessions ? Other features like user email and logging in I want those in CI sessions and not in database. Thank you Cart - Cookie problem (size of cart) - El Forum - 07-16-2012 [eluser]mallix[/eluser] I guess I will have to use the database for the headache to be over. |