I have a Tea Commerce shop, where you can buy a product and select what day to pick it up. The pickup date is stored in a seperate table, along with a bunch of other custom details. I am aware of the custom order line property feature, but I wanted a bit more control.
Now if a customer wants to buy the same product, but with a different pickup date then I need to handle that as a new order line. It seems that the isUnique argument, might be an easy way to do just that? If the customer does not have a product in his cart with the same pickup date, then isUnique is true and otherwise its false.
Does that sound correct, or am I missing something.
isUnique will make sure that to update a specific order line, you need the order line id. In your case your JavaScript will need some changes.
When adding a product: You will need to check the existing order lines to see if one of them matches the product identifier and the pickup date. If there's a match you update that one using it's order line id If there's no match you add the new order line using the product identifier and the isUnique=true
The isUnique argument
Hi,
I have a Tea Commerce shop, where you can buy a product and select what day to pick it up. The pickup date is stored in a seperate table, along with a bunch of other custom details. I am aware of the custom order line property feature, but I wanted a bit more control.
Now if a customer wants to buy the same product, but with a different pickup date then I need to handle that as a new order line. It seems that the isUnique argument, might be an easy way to do just that? If the customer does not have a product in his cart with the same pickup date, then isUnique is true and otherwise its false.
Does that sound correct, or am I missing something.
Cheers
Bjørn
Yes, that would be a fine way to do it.
isUnique will make sure that to update a specific order line, you need the order line id. In your case your JavaScript will need some changes.
When adding a product:
You will need to check the existing order lines to see if one of them matches the product identifier and the pickup date.
If there's a match you update that one using it's order line id
If there's no match you add the new order line using the product identifier and the isUnique=true
/Rune
Hej Rune,
Great I was hoping as much, but wanted to check with the masters before I went further down this path. Thanks :)
Cheers
Bjørn
Cool. Hope it will work out for you. Otherwise feel free to ask again.
Could you please mark the correct answer for others to see.
/Rune
is working on a reply...