Jump to content

Archived

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

paruby

[SOLVED] Shopping Cart help please

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

Share this post


Link to post
Share on other sites

Thanx kumarkiranm .  That is exactly what I am looking for. And it's a great place to start w/ AJAX.  I have been hesitant to get into it, but looks very easy here!

 

Pete

Share this post


Link to post
Share on other sites

×
×
  • 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.