Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have a requirement to limit the purchase of certain items to 1. I have stopped the quantity being changed while adding to the basket, but if the same product is added again, it is combined with the previous product and the quantity changes to 2.
I either need to stop the second (exact same) item being added to the basket, or allow it to be added but as a separate order line.
Adding it as a separate line in the basket would, I think, be preferable - but is it possible?
Depending on how important it is to enforce the 1 item policy you should either:
Do it on the server
Add a custom property to the order line, so you can identify it and then clean up the order everytime it updates.
OK, I've used NotificationCenter.Order.OrderLinesUpdating to check for the specific product type and set / force the qty to 1. Seems to work!
That's what I usually do. It's the most secure way to go. Customers can't cheat it that way.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted