Jump to content

[SOLVED] Shopping Cart help please


paruby

Recommended Posts

i am trying to create a shopping cart system, like peapod.com, or netgrocer.com.  I noticed 2 things that I would like to replicate :: 1. When you change the quantity, the page does not refresh, and 2. the shopping cart on the right frame does update, and refresh.

 

I think I have found how the quantity changes w/out a page refresh, with javascript.  but, I can not determine how to (at the same time) update the DB with the new quantity to update the shopping cart.  Since I can not call PHP from javascript, I was hoping I could put code on the "onChange" event of the quantity field to only update the DB and only refresh the shopping cart data, again, without having the main page refresh.  If you see my code at http://lpbj.net/eshop/, you will see I tried to put a basic alert messagebox on the "onChange" event, but it doesn't always fire (event tried changing the focus)...

 

Anyway, hopefully I can get some help/ ideas on the best way to do this.  As a side note, I have seen examples putting all the quantities/products into an array, but my concern is that the user will leave before checking out and saving the data to the DB, and i would like the shopping cart to be dynamically changing...

 

Pete

Link to comment
https://forums.phpfreaks.com/topic/173426-solved-shopping-cart-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.