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

How do I add options to products

Thread began 2/08/2010 5:10 pm by crispin | Last modified 2/16/2010 5:01 pm by crispin | 2465 views | 12 replies

Jason ByrnesWebAssist

In your eCart object, create a new column named Colors. make sure to check the Unique Checkbox.

In a dynamic site with product options, you are best off adding the add to cart button to the product detail page. The results page will pass the product ID to the detail page as a query string variable, make note of this variable name.

When you add the add to cart button, set the Color column to be upgradeable from a select list. This will add the color select list to the page.

To populate the color select list, you will need to create a recordset to lookup the options from the database.

the sample eCommerce database is configured to be very flexible with product options. you can have different option categories such as size and color. You will need to create a separate recordset for each category. the tables that control options are:

optiongroups - defines the options groups:
OptionGroupID - Primary Key
OptionGroupName - Name of the option group, like size or color

options - defines the options, and assigns them to the option group:
OptionID - Primary Key
OptionGroupID - Forieign Key relation to optiongroups.OptionGroupID
OptionName - name of Option like Small or Red

productoptions - used to assign an option to a product:
ProductOptionID - Primary Key
ProductID - Forieign Key relation to product.ProductID
OptionID - Forieign Key relation to options.OptionID
OptionGroupID - Forieign Key relation to optiongroups.OptionGroupID
OptionPriceIncrement - used if the option should affect price.

from the optiongroups table, you will need to know the OptionGroupID value for the option group you are creating the recordset for. if the Color option group has an OptionGroupID of 1, the recordset will look like:

SELECT options.*
FROM options
INNER JOIN productoptions ON options.OptionID = productoptions.OptionID
WHERE options.OptionGroupID = 1 AND productoptions.ProductID = paramOptionID

you will need to create paramOptionID as a parameter in the Advanced recordset view to use the querystring variable that passes the product ID

Name: paramOptionID
type: Number
default value: -1
Run Time value: $_GET['<Querystring Variable Name>']

substitute <Querystring Variable Name> with the name of the querystring variable.

Once the recordset has been created, select the Color dropdown list in design view, in the property inspector, click the dynamic button. Select the recordset that was just created in the option from Recordset list, for both the name and the value, select the Option Name column.

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