DEV Community

Discussion on: Dynamics 365 (E-)Commerce development Proof of Concept (2)

Collapse
 
hassanamjad91 profile image
Muhammad Hassan Amjad

Hey Rob, Great article!

I am trying tp put a limit on the cart itself such that users can only add 1 item.
Can you suggest the best approach to achieve this?

Thanks.

Collapse
 
robvanb profile image
Rob vanBrandenburg

HI Muhammad, just from the top of my head, I would say, find out which action is called to add items to a cart. Then trace that to the actual CRT method that is being called.
Once you know that, you can extend that method by adding the logic to check for the number of items in the cart, and send the appropriate message back to the front end.
Hope this helps.