wojodesign/simplecart-js — Issue #160: load cart from database instead of cookie
Author: twitchsbrew
Created: 2011-10-31 14:13:35+00:00
State: open

Can't say enough how much I enjoy working with this cart. I was wondering if anyone has successfully loaded the cart from a database table instead of the cookie. I am using the cart for reserving certain products. I want the user to be able to go in and edit what they have reserved so I need the cart to show products that were stored in the database. The PHP code to create the products from the database is easy enough (I generate the itemContainer template with the values filled from the database), however I need the javascript that will parse the itemContainer and figure out quantities and prices of the products like it does when it gets the products form the cookies. When I loop through the reserved products the "load from cookie" code overrides the products I create from the database. If I comment out the load from cookie code, the products appear properly in the cart but totals and quantities don't update.

I know there isn't a simple solution but I was just hoping someone as already done this and has some sample code.

Thanks in advance,
Twitch