• Status: Solved
  • Priority: High
  • Security: Private
  • Views: 80
  • Last Modified:

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

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.
0
sqlagent007
Asked:
sqlagent007
  • 2
1 Solution
 
sqlagent007Author 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
0
 
Php_expertCommented:
Hi,

I think you have to play around with JS to have default selection on PDP page load.
0
 
sqlagent007Author Commented:
Thanks, that is what we ended up with.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now