Problem/Motivation

Steps to replicate:

  • User already has a license role
  • User chooses to add the same licensed product to the cart

User sees add to cart message, and another message You already have the foobar role. You may not purchase the foobar product.. And there is nothing added to the cart.

Proposed resolution

The check should be done before the item is added to cart.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Comments

subhojit777 created an issue. See original summary.

joachim’s picture

Category: Bug report » Support request

>The check should be done before the item is added to cart.

It's not as simple as that, unfortunately...

Try one of these commerce patches -- I forget which one does the trick:

- #2903504: Add form validations in Cartform and in AddToCartForm
- #2930979: don't show the 'added to your cart' message if the item quantity is unchanged or 0; make CartEntityAddEvent aware of the original order item

drupgirl’s picture

Status: Active » Closed (duplicate)