close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Product Options

Thread began 7/05/2011 2:58 pm by admin394099 | Last modified 4/16/2012 4:32 pm by admin394099 | 8020 views | 30 replies

Jason ByrnesWebAssist

Well, in the eCommerce database, the ProductID should be a numeric value that is set by the database, you should not be setting the ProductID value. the productID column is the primary key column of the database, let the database set the productID value, you can set the ProductSKU column to "CMC-02x03" but that is something completely different.


When working with relational tables, you work with the primary key columns, so if your products record looks like this:

+-----------+------------+-------------+
| ProductID | ProductSKU | ProductName |
+-----------+------------+-------------+
| 1 | CMC-02x03 | Doormat |
+-----------+------------+-------------+




the value that will be used to draw the relations in the productoptions table is the productID.

first you need to define the optiongroup in the options table, for example:

+---------------+------------------+
| OptionGroupID | OptionsGroupName |
+---------------+------------------+
| 1 | size |
+---------------+------------------+
| 2 | color |
+---------------+------------------+




Now, you can define the options that belong to each group in the options table:

+----------+---------------+------------+
| OptionID | OptionGroupID | OptionName |
+----------+---------------+------------+
| 1 | 1 | small |
+----------+---------------+------------+
| 2 | 1 | medium |
+----------+---------------+------------+
| 3 | 1 | large |
+----------+---------------+------------+
| 4 | 2 | red |
+----------+---------------+------------+
| 5 | 2 | yellow |
+----------+---------------+------------+
| 6 | 2 | green |
+----------+---------------+------------+
| 7 | 2 | blue |
+----------+---------------+------------+



now, you can use the productoptions table to relate the product to the options.

using the sample data, the product ID is 1, the optiongroupid for the color option group is 2 and the option ID for the red yeelow blue colors are 4, 5, and 7

we need to following records to create a red yellow and blue option for our sample product:

+-----------------+-----------+----------+---------------+----------------------+
| ProductOptionID | ProductID | OptionID | OptionGroupID | OptionPriceIncrement |
+-----------------+-----------+----------+---------------+----------------------+
| 1 | 1 | 4 | 2 | |
+-----------------+-----------+----------+---------------+----------------------+
| 2 | 1 | 5 | 2 | |
+-----------------+-----------+----------+---------------+----------------------+
| 3 | 1 | 7 | 2 | |
+-----------------+-----------+----------+---------------+----------------------+

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