Before_add_line_item - max quantity of products in cart #2697
Unanswered
mattgeminiworktops
asked this question in
Q&A
Replies: 1 comment
-
Thank you for your question. Adding an error to the order model should get this working for you. For example the addition of the line Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using a before_add_line_item event to restrict the number of samples (product type) added to the cart to three.
It works to an extent as it will not add more than 3 samples to the cart, however the 'addedToCart' a toast style flash message is still displaying the success message.
I also have a max qty set on each individual product via Commerce as 1 - and this triggers a Cart Error. Ideally I would like to trigger an error when user tries to add more than three items to the cart, which displays as a toast style notification..
Any help appreciated!
Beta Was this translation helpful? Give feedback.
All reactions