My Magento 2 store has special products, which shouldn't be bought mixed with other products. How would I achieve the following:
Don't allow other products in cart if special product in cart already.
Don't allow special product in cart if it already contains other items.
So the cart must contain either only special products (perhaps targeted by category) or only other products. But never the mix of the two.
I would need to display a message to the user as well on product pages, so they understand why they are not allowed to add those products.
Hi @irealunknod8a4 ,
You can use event observers to achieve your requirement.
Here is an example: https://envisionecommerce.com/blog/how-to-check-condition-before-product-add-to-cart/
Problem Solved? Accept as Solution!
Hope it helps!
Thanks