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

database setup where price depends on size and color,style are options.

Thread began 4/15/2010 12:12 am by sologray | Last modified 12/12/2013 1:16 am by sologray | 6044 views | 12 replies

Jason ByrnesWebAssist

yes, the eCommerce database would accomplish this.

The tables use Primary key and Foreign Key column to relate to one another

In the products table, the ProductID is the Primary key, the product data would look like:

ProductID | ProductName etc
1 | wefted hair
2 | prebonded hair
3 | wigs

The optiongroups table uses the OptionGroupID as the primary key. the options groups data would look like:
OptionGroupID | OptionGroupName
1 | Color
2 | Size
3 | Style

The Options table uses the OptionID as the primary key and the OptionGroupID to relate the option to the option group. To add the color options, the OptionGroupID, will use the value 1, size will use the value 2 and style will use 3 :
OptionID | OptionGroupID | OptionName
1 | 1 |Black
2 | 1 |Dark Brown
3 | 1 |Medium Brown
4 | 1 |Light Brown
5 | 1 |Pale Blond
6 | 2 |12 inch
7 | 2 |14 inch
8 | 2 |24 inch
9 | 3 |straight
10 | 3 |deep wave
11 | 3 |french-curl
12 | 3 |loose wave

the productoptions table is used to tie the option to the product and add a price increment if the options will add to the base price set in the product table.

The OptionID is the primary key. ProductID is a foreign key relation to the product table. optionID is a foreign key relation to the Options table and OptionGroupID is a foreign key relation to the option groups table.

ProductOptionsID | ProductID | OptionID | OptionGroupID | OptionPriceIncrement
1 | 1 | 2 | 1 | 0

the example above uses:
productID 1 which is wefted hair.
OptionID 2 which is Dark Brown
OptionGroupID 1 which is color
OptionPriceIncrement 0

ProductOptionsID | ProductID | OptionID | OptionGroupID | OptionPriceIncrement
2 | 2 | 7 | 2 | 5.95

the example above uses:
productID 2 which is prebonded hair
OptionID 7 which is 14 inch
OptionGroupID 2 which is size
OptionPriceIncrement 5.95 This will be added to the base price set in the product table.

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