Jump to content

Force configurable option based on other selections


SeanP

Recommended Posts

I have a particular configurable option for a product that I  need to force selection of, based on the selections made of the other configurable options.

------------------------------

Example:

Option 1: A (selected)

Option 2: B (selected)

Option 3: C (selected)

Forced Option 4:  ABC (force selected)

 

Changing the options:

Option 1: B (selected)

Option 2: C (selected)

Option 3: A (selected)

Forced Option 4:  BCA (force selected)

------------------------------

I know the Order Summary is updating on the fly when selecting product options, and I'm wanting to dynamically have it select the proper option on the forced configurable option so the order summary looks correct.  Also, the one configurable option I want to force is hidden on the form, the others you select are not.  I'm not sure if that will make a difference in trying to force it.

Link to comment
Share on other sites

For on the fly forcing you would need javascript injected via a output hook or overriding an existing variable.  For example, using ShoppingCartCheckoutOutput and injecting jquery to watch for configuration field change:

$('#inputConfigOption10').change(function() {
 $('#inputConfigOption11').value('10');
});
You'll need to get the config option field ID (the 10 and 11) from the service's configurable options array and use that instead of the hard coded number.  Also, the jquery to change the value would be different for drop down menus and maybe sliders. 
 
Using the shopping cart checkout validation to confirm those configurable options are set as they should be should also be done. 

 

Link to comment
Share on other sites

22 hours ago, steven99 said:

For on the fly forcing you would need javascript injected via a output hook or overriding an existing variable.  For example, using ShoppingCartCheckoutOutput and injecting jquery to watch for configuration field change:


$('#inputConfigOption10').change(function() {
 $('#inputConfigOption11').value('10');
});
You'll need to get the config option field ID (the 10 and 11) from the service's configurable options array and use that instead of the hard coded number.  Also, the jquery to change the value would be different for drop down menus and maybe sliders. 
 
Using the shopping cart checkout validation to confirm those configurable options are set as they should be should also be done. 

 

Thanks for the reply.  I figured it would probably have to be done in javascript.  I need to see if it is possible based on my current configurable options.  I appreciate the help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated