Product Options - Metal/Color and Size
Alright, so I am creating a wholesale jewelry site and would like to have 2 options - size (different prices by size) and metal (gold/silver, with price difference).
The thing is, not all jewelry items are available in both gold and silver and not all items have a size option (only rings). Also, not every ring is available in every size.
So the way I set it up was I added a column in my products table for ProductCategory, which contains the first few numbers of the SKU.
I would like the product options to show size options for rings (ProductCategory=400) and metal options for ProductCategory=635. I have my tables set up like this:
optiongroups:
OptionGroupID | OptionGroupName
1 | Size
2 | Metal
options:
OptionID | OptionGroupID | OptionName
1 | 2 | Sterling Silver
2 | 2 | 14K Gold
3 | 1 | size 3
4 | 1 | size 4
5 | 1 | size 5
productoptions:
ProductOptionID | ProductCategory | ProductID | OptionID | OptionGroupID | OptionPriceIncrement
1 | 635 | - | 1 | 2 | -
2 | 635 | - | 2 | 2 | 2.00
3 | 400 | 400101 | 3 | 1 | -
4 | 400 | 400101 | 4 | 1 | 0.50
5 | 400 | 400101 | 5 | 1 | 1.00
products:
ProductCategory | ProductID (primary key) | ...Price, Desc, etc
635 | 635101 | ...
635 | 635102 | ...
400 | 400101 | ...
400 | 400102 | ...
Now, starting with metal (because I gave up on size to focus on this part), I have this in the SQL for rsMetal:
SELECT productoptions.OptionPriceincrement, productoptions.ProductOptionID, options.OptionName, options.OptionGroupID, optiongroups.OptionGroupName
FROM options INNER JOIN productoptions ON options.OptionID = productoptions.OptionID INNER JOIN optiongroups ON options.OptionGroupID = optiongroups.OptionGroupID
WHERE optiongroups.OptionGroupName = 'Metal' AND productoptions.ProductCategory = paramItem
With ParamItem default value: -1, runtime value: $row_WADAproducts['ProductCategory']
I'm following the rest of the directions exactly from the Product Options how-to for the dynamic menu and all I'm getting is a blank menu with the heading "Choose a metal." I don't know what I'm doing wrong.