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

Admin - Assigning Product Options - Revised Help

Thread began 4/11/2012 1:45 am by Christopher West | Last modified 4/12/2012 10:57 am by Christopher West | 625 views | 3 replies

Christopher WestCommunity Expert

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

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