'Hide or edit the "You cannot add another 'xxx' to your cart" error message in WooCommerce 4.5+
Via the product settings I enabled "sold individually: enable this to only allow one item to be bought in a single order"
While adding the same product to cart, there appears an error message because I enabled this setting. The error message is "You cannot add another 'xxx' to your cart". I don't want the same product added to the cart, so this works fine and good.
My question:
How to hide the error message "You cannot add another 'xxx' to your cart".
If I use the CSS code
.woocommerce-error {
display: none;
}
Then the error password or email when we log in is hidden too, I don't want to hide another error message.
Is it possible to achieve only for this error to be hidden?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
