This is a follow up on this post.
Intro
In the first part we saw how we can extend the CRT to include additional fields in the extensio...
For further actions, you may consider blocking this person and/or reporting abuse
Hi Rob,
I tried the same thing and as your screenshot I have also two buttons (Add to bag & empty). Why is this happening? And after closing the alert message system raises error message "Unhandled Rejection (Error): [getActiveCartWithProdcuts]Unable to hydrate cart with product information". I think add to cart couldn't work properly.
Hi Erkan, I'm not sure what you mean when you say you have 2 buttons? Can you post a screenshot?
As to your error, are you modifying the cart contents at all in your code?
Hi Rob,
I attached the screenshot. In your screenshot I can also see the other button in orange color. I just override AddToCart and even though I didn't modify it I have two buttons. When I click the button with caption it adds the item into basket and after that raises error message. When I click the second button without caption system tries to login and do nothing.
dev-to-uploads.s3.amazonaws.com/up...
dev-to-uploads.s3.amazonaws.com/up...
Erkan - sorry for the delay. I finally had a chance to look into this. I had not even noticed this myself :)
I wonder if this is a bug in the Theme extension / Component extension framework. If I look at the generated page, I see that there actually are 2 buttons (see attached screenshot). However, the extended component only has one. I might post this in the Yammer group to see if I can get some insight from others and possibly Microsoft. Good find!
dev-to-uploads.s3.amazonaws.com/up...
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.
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.