Potential Variation Bug
-
Hi there,
Love the plugins by the way. I am here to talk about the Swatch Plugin specifically though as there seems to be either a bug, or a lacking user experience implementation.
In the default state when you load the page, the add to cart button has disabled wc-variation-selection-needed classes assigned to it. When you click add to cart the alert: “Please select some product options before adding this product to your basket.” appears. – This is as I would expect.
However, if you are using the setting to pre-select an attribute (colour for example), the page loads with classes: disabled wc-variation-selection-needed but then changes to disabled wc-variation-is-unavailable once the variation pre-select reloads the gallery. When the add to cart button is clicked, the alert returns: “Sorry, this product is unavailable. Please choose a different combination.” – This is not as I would expect.If we are using the pre-selected option, we want the user to click the size / waist size / whatever before clicking the add to cart button, but, for whatever reason if they forget to click on the drop down menus on the page I linked above, then they are met with this “Sorry, this product is unavailable..” message – which looking at Hotjar recordings is when they terminate the session with us.
Example / Scenario:
Using my linked page as an example, if I loaded the page, I would get the add to cart button with the disabled wc-variation-is-unavailable as mentioned before, if I select the size and click S/M, the disabled wc-variation-is-unavailable classes are removed (because of course all options have been selected), however, if I clear the S/M choice and set it to “choose an option”, the class on the add to cart button doesn’t revert to disabled wc-variation-is-unavailable, instead it reverts to disabled wc-variation-selection-needed.
I think, when the code assigns the classes, it should check to see if the global settings included a pre-selected attribute, and if so, the add to cart button should be using the wc-variation-selection-needed class and not the wc-variation-is-unavailable class.
Sadly my mutation observer won’t work because it seems you have one running on your plugin which is fighting mine to change the class to the selected-needed version.
Regards
KaneThe page I need help with: [log in to see the link]
- The topic ‘Potential Variation Bug’ is closed to new replies.