Jump to content

Multiple Items to Shopping Cart


FETNU

Recommended Posts

Before I dive into the coding for the next part of my application, I'm trying to figure out the best way to accomplish this.

 

Here's the history:

When opening the page, I grab ALL the items from the ITEM_SELECTION table (mysql database) by item_category (for example baby clothes, toys, bath products, etc..).  I then display all those items on the page (so this page would contain all baby clothes).... The user has the option to scroll down the page and change the quantities to whatever numeric values they want.  Now, the part that I'm trying to figure out...

 

When the user clicks the "Update Quantities" button I need to Add, update or delete these items to my SHOPPING_BASKET_TEMP table.  So, I need to see if the item already exists in the temp table, if so, I either need to update the quantity or delete the row (depending on the value the user entered).  If it does not exist, then I need to insert the record into the table.  Each page could have up to 20 items on it, so I'm thinking I need to use arrays????

 

Any recommendations???  I'm fairly new to PHP and mySQL, but I've taught myself everything up to this point and I have pretty good e-commerce application going so far.  At this point, I'm mainly looking for a high level explanation to achieve this.  Any help over this next hump is greatly appreciated.

Thanks!

      FETNU

 

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.