Admin - Assigning Product Options - Revised Help
Hi, in reference to something I have enquired about before, And after coding part of the admin area to add/update Product OPTIONGROUPS and Product OPTIONS for an online store. I just need need help on the steps connect the PRODUCTOPTIONS to a product.
I have attached an image to show what I need. I just cannot get my head around the best way of doing it.
the image is a screenshot of some options that pulled in by a URL ProductID reference.
ProductGroups are made up of either (1) text box option (2) tick box option (3) select list of options (the select list contents also differs per optiongroup). (on the example page you only see options for text box or select list) the tick boxes on the right side are additional "choices" for the ProductOptions table that is used to reference to the product.
I want the admin to add a "option group" to a product this is then displayed in the example screenshot (note: Admin can add the same OptionGroup as you can see in the screenshot).
The screenshot is based on code I have already put in place. EG to display the Options that you can see in the screenshot I used:
SELECT *
FROM productoptions LEFT JOIN optiongroups ON productoptions.OptionGroupID = optiongroups.OptionGroupID
WHERE ProductID = colname
The point of the tick box on the far left will allow the Admin to "deselect" the tickbox so that when the save button is pressed it will delete the association of that particular option from the product.
The select list that you see in the bigger box will also output the options associated with that particular optiongroup (which I had assigned on a different page to create an optiongroup. - So Im guessing I would need to hand code a recordset inside the "repeat region of the form.
Also I am guessing I would need to used an Update Multiple records as well.
But this is where I am stuck, as I cannot seem to figure out method of coding..
Could you please let me know the the method of getting this particular page to work in how I described above?
Here is an idea of my databse structure to get an idea on how it all connects:
CREATE `optiongroups` (
`OptionGroupID` int(11) NOT NULL AUTO_INCREMENT,
`OptionGroupName` varchar(50) DEFAULT NULL,
`OptionGroupType` varchar(20) NOT NULL,
PRIMARY KEY (`OptionGroupID`)
CREATE `options` (
`OptionID` int(11) NOT NULL AUTO_INCREMENT,
`OptionGroupID` int(11) DEFAULT NULL,
`OptionName` varchar(50) DEFAULT NULL,
`OptionPrice` float NOT NULL,
PRIMARY KEY (`OptionID`)
TABLE `productoptions` (
`ProductOptionID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ProductID` int(10) unsigned NOT NULL,
`OptionGroupID` int(10) unsigned NOT NULL,
`OptionIncluded` tinyint(1) NOT NULL,
`OptionRequired` tinyint(1) NOT NULL,
`OptionSort` int(3) NOT NULL,
PRIMARY KEY (`ProductOptionID`)
regards
Chris