This topic has 6 replies, 3 voices, and was last updated 8 years, 5 months ago ago by Jack Richardson
Hi,
On a product with variations, if I click ‘add to basket’ without first choosing a selection, the following modal pop-up appears: “Please select some product options before adding this product to your cart”
After pressing ‘OK’ I then get a pop-up to say that the item has been successfully added to shopping cart. However, this is not case as when I go to checkout it states in red: “You cannot add that amount of “ELTER” to the basket because there is not enough stock (0 remaining).”
This doesn’t make sense, it should not be possible to even add the default product to shopping cart, without first making a selection.
Even with the option ‘Enable stock management at product level’ disabled, I can repeat the same steps, only this time the default product is added to the cart which doesn’t make sense either.
Stock is managed at variation level just to point out.
Is there a way of disabling the add to cart button until a selection (variation) is made? or preventing the product being added to the cart, as this is what the first pop-up suggests but is now the case.
Thank you in advance
Hello,
Please provide us with WP Dashboard credentials in private content.
Best regards,
Jack Richardson.
Thank you for such a quick reply. Information supplied below:
Hello,
I’ve disabled “Ajax Add to Cart” option in Theme Options > Single Product Page.
Please clear browser cache and check the page now.
Regards,
Eva Kemp.
Thank you Eva, though I would prefer to use ‘Ajax Add to Cart’ as this looks really nice.
I decided to go with a CSS based soution:
.woocommerce-variation-add-to-cart-disabled{
opacity: 0.3;
pointer-events: none;
cursor: default;
}
which prevents the add to cart button from being clicked until a selection is made. Posted the code here in case you have any reservations about it, or to benefit others.
Hello,
We’re glad you’ve found the solution and thank you for sharing the code.
Best regards,
Jack Richardson.
The issue related to '‘Add to basket – product variations’' has been successfully resolved, and the topic is now closed for further responses