2

I have created a configurable product in magento store with two attributes say color and size.

On product page second dropdown box (say size) is disabled by default untill any attribute value not select from first dropdown box(say color).

How to display attribute values of second dropdown box without selecting any attribute value from first dropdown box?

Thanks in advance.

1
  • 1
    Changing the order of the options is not an option?
    – Jeroen
    Commented Mar 12, 2015 at 7:50

2 Answers 2

1

Technically, you cannot select a value from the second dropdown until you select one from the first dropdown, because the values in the second one depend on the selected value from the first dropdown.
Practically you can overcome this, but assigning a default selected configuration when the page loads.
Here is a free extension that allows you to do just this. It allows you to select for each configurable product a default selection, or if none is set you can auto select the first available combination.
Beside this, it does more. It allows you to change the dropdowns to image or color labels and it changes the product image when a combination is selected.
Full documentation can be found here

0

I would use jQuery and do something like this:

jQuery(document).ready(function(){
   // Disable the second dropdown on load
   jQuery('id-of-the-second-dropdown').prop('disabled',true);
   // When the first dropdown is changed
   jQuery('id-of-the-first-dropdown').on('change',function(){
      // Check if the second dropdown is still disabled
      if(jQuery('id-of-the-second-dropdown').is(':disabled')
      {
          // Enable it if it's still disabled
          jQuery('id-of-the-second-dropdown').prop('disabled',false);
      }
   });
});
1
  • Please read my question correctly.. I want to display attribute values of second dropdown box without selecting any attribute value from first dropdown box. Commented Mar 7, 2015 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.