close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding items to cart by size/price

Thread began 5/28/2009 8:01 am by jenbar3378469 | Last modified 7/01/2009 1:18 pm by dacker1313513 | 3447 views | 9 replies |

jenbar3378469

Adding items to cart by size/price

Hi, Can someone tell me how to add items using ecart, php, dreamweaver when there are different sizes and the different sizes have different prices? For example, we sell a shirt that comes in med, large and Xlarge. The med & large sizes cost $29.00, but the XLarge costs $31.00. How could the "add to cart" button be set up so that once XLarge is selected from the pull-down menu (the select list) the price of $31.00 would automatically populate in the shopping cart?

Please help.

Thanks!

Sign in to reply to this post

Ray BorduinWebAssist

You could have the additional price stored in the database with the size option it corresponds to.

Then when the add to cart form is submitted with that option selected, add a recordset above the add to cart to get the additional price associated with that option and add it to the cart instead of the base price. You could either add it to the price, store the adjusted price, or have an extra column in the cart for OptionPrice... all should work.

Sign in to reply to this post
Did this help? Tips are appreciated...

jenbar3378469

Thanks again Ray, but how do I store the adjusted price? And with the option you discussed, do you mean put a hidden field above the "add to cart" button with the price difference attached? How would I call this out in the code? Thanks again!

Sign in to reply to this post

Ray BorduinWebAssist

You would store the adjusted price in a column in your database just like the options themselves.

No hidden field. Filter a recordset with the list of sizes and use the recordset directly without a hidden field.

Sign in to reply to this post
Did this help? Tips are appreciated...

jenbar3378469

Thanks Ray! I think I understand this now!

Sign in to reply to this post

jenbar3378469

Ray, I know I said I understand, but I tried to do it and it is not working. Right now I have my database set up so that each color of each shirt has is on it's own line with it's own item id. Is this set up incorrectly? Should I set the database up differently for instance, should I have Men's Shirt, then a size M column, a size L column, a size XL column along with separate price columns?

Also where do I filter the recordset, on the add to cart or the actual drop down menu? Filtering on the actual drop down menu only allows you to use one filter though, so I am now sooo confused. Please help!

Thanks!

Sign in to reply to this post

Ray BorduinWebAssist

You can use any database schema that works for your application. I can't claim to know enough about your business or product line to design the correct database for you with the limited information I have. If the database structure avoids repeated data that can be out of synch and encapsulates all of the data you will need to build your application, then it is good.

Get the dropdown menu populated with your color choices first. Don't worry about how you will tie it to the cart. If you have your list populated so the form looks correct then you are ready to move on to the next step.

Set the values of the list where your choices appear to the ID field in the database for the corresponding row in the table where you will find the new price.

Then you can create a new recordset on top of that page and filter it with the list id that is submitted in the form. That recordset then could return the new price column which you could bind in the add to cart button.

Sign in to reply to this post
Did this help? Tips are appreciated...

dacker1313513

I'm having a simular problem. I have 1 item, 4 different sizes. I can't seem to associate a dropdown list with a add to cart button. There has got to be a way to do this.

Sign in to reply to this post

Ray BorduinWebAssist

Use the dropdown list to filter a recordset that you add to the page.

Then refer to that recordset in your add to cart.

Sign in to reply to this post
Did this help? Tips are appreciated...

dacker1313513

Thank you.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...