Magento 2.1 - How can I remove the ability for a user to UNSELECT a swatch image?

sqlagent007
sqlagent007 used Ask the Experts™
on
Magento 2.1 - How can I remove the ability for a user to UNSELECT a swatch image?

I have all configurable products, I have created default simple product configurations for all configurable products. In the configurable product I have a double swatch configuration and if the user accidentally clicks twice on a swatch image, that option becomes UNSELECTED. I need to remove the ability for the user to UNSELECT any swatch, the configurable product must always have a swatch selected. The user can choose different configurations, and move about, but should never be allowed to select nothing.

I have configured default configurations on all configurable products and I want the swatches to behave like radio buttons in that the user always has 1 of each selected. We have a total of 2 possible swatches. FRAME color and LENS color; one of each must always be selected.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
sqlagent007Technology professional

Author

Commented:
I forgot to add the version...We are using CE.

Wrangler jeans does a good job of this and I know they are EE, but I have to believe there is a way to do this in CE.

Notice on this page you can never UNSELECT a jean COLOR
https://www.wrangler.com/shop/men-jeans-by-fit-slim/wrangler-retro-jean-slim-straight?variationId=88MWZTB#hero=0
Hi,

I think you have to play around with JS to have default selection on PDP page load.
sqlagent007Technology professional

Author

Commented:
Thanks, that is what we ended up with.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial