close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Product Options implementation

Thread began 7/25/2010 3:34 pm by victor405909 | Last modified 9/15/2010 2:14 pm by victor405909 | 2133 views | 26 replies

CraigRBeta Tester

Here's what to do, I hope it's clear.

BTW, I recommend you hold ALL prices in your prices table.
If you have your data in different places, it becomes hard to debug.

(The structure i laid out is not for a price surcharge, it is to replace the price value in your products table)

Assuming your add to cart button is on your productdetail page...

The way ecart works, is that when you click the add to cart button, the add to cart form posts its data into the ecart array.

when the customer opens the productdetail page, they have selected the productid, but not any 'options' ie size, and hence at this point, the price is unknown.

have the sizes available for this productid in a select list, within your add to cart form

when the customer chooses a size and clicks 'add to cart' the form is posted.

you need to add some code to check for the form being posted, (before the code for the cart putting data into the array.)
if it has been posted, you run a lookup query, which looks up the priceoptions table, where the productid is the url variable and the sizeid is the value returned from the select list in the posted form.

this will return 1 row from your lookup query with the price.
use this price in the ecart array

same principle applies for colour or any other options you may use

read through this a couple of times, it may seem a bit complicated, but you will appreciate the logic

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





Ease of use


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