I have a configurable product with one colour and different sizes, both these are set as required fields.
I've set the colour attribute as not required, but then it wont show up when I create a configurable product and wont show on the product page.
How do I get the colour swatch to be automatically selected when the product page loads?
Best Answer
Open this file from app\design\frontend[your package][your theme]\template\catalog\product\view\type\options\configurable.phtml
Now add the below javascript code :-
after this code :-
and flush magento cache and check.