By firoz2456 on
I am using Drupal8, Commerce 2, Commerce Recurring and Commerce Licence.
I am selling yearly subscription.
Issue and Steps
- User can add subscription product into cart
- User redirecting to cart page
- User hits back button and visit product page(subscription page) again.
- User again add subscription product into cart.
- Then user end up with 2 same subscription products into cart. Need to restrict user to add multiple product into cart.
Possible solution:
I want to clear cart whenever new product is added. So every time there will be only one product in the cart.
Note: I have tried to restrict one quantity for the product. As I am not displaying the cart page to the user, this solution is not working.
Comments
I'm trying to achieve te same
I'm trying to achieve the same. No luck so far.
Hi,
Hi,
You can subscribe this event :
This worked for me thank you
This worked for me thank you arthur_drupal.
In a custom module
Lets use injections