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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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