When I hit submit on product 1, it's successfully added to the basket. However on product 2 (a different page) when I hit add to cart, it just increases the quantity on product 1 in the cart, rather than adding product 2.
I've checked the data being sent to the FormPost.aspx and productIdentifier is definitely different each time, but for some reason it just doesn't doesn't want to add product 2.
Ahhh, my bad, I had forgotten to give the 2 products a unique sku, so when it was looking the product up in the cart, because neither had an sku, it was falsley matching them.
One thing is that Matt will give it a shot today and remove the sku and see if there is a bug in Tea Commerce. Try and remove the sku's and see what sku Tea Commerce gives the first order line. It should fallback to use the nodeId as sku.
So Product 1 has an sku, but Vairants 1 and 2 didn't. Now when either Vairant 1 or Variant 2 were added to the cart, they ended up with the sku of Product 1, therfore in the cart the quantity was incremented rather than a new order line created.
That is an expected and correct behavier. You will learn more about that at the UK Tea Commerce certification cource :) Every product should have a unique SKU if you use SKU. Else dont have any at all and use the node id as SKU.
AddOrUpdateOrderLine incrementing qty instead of adding new orderline
Hi Guys,
I've implemented adding a product to the basket using FormPost.aspx and ajax form as follows:
When I hit submit on product 1, it's successfully added to the basket. However on product 2 (a different page) when I hit add to cart, it just increases the quantity on product 1 in the cart, rather than adding product 2.
I've checked the data being sent to the FormPost.aspx and productIdentifier is definitely different each time, but for some reason it just doesn't doesn't want to add product 2.
Any suggestions?
Many thanks
Matt
Ahhh, my bad, I had forgotten to give the 2 products a unique sku, so when it was looking the product up in the cart, because neither had an sku, it was falsley matching them.
Adding sku's fixed it :)
Matt
Good thing you figured it out :)
Give yourself a correct answer so others can see you solved it.
/Rune
One thing is that Matt will give it a shot today and remove the sku and see if there is a bug in Tea Commerce. Try and remove the sku's and see what sku Tea Commerce gives the first order line. It should fallback to use the nodeId as sku.
Kind regards
Anders
Hey Guys,
So here is what is happening. My site structure is as follows:
Store
--- Category [DocType: Category]
------ Product 1 [DocType: Product]
--------- Variant 1 [DocType: Product]
--------- Variant 2 [DocType: Product]
So Product 1 has an sku, but Vairants 1 and 2 didn't. Now when either Vairant 1 or Variant 2 were added to the cart, they ended up with the sku of Product 1, therfore in the cart the quantity was incremented rather than a new order line created.
Hope this helps
Cheers
Matt
That is an expected and correct behavier. You will learn more about that at the UK Tea Commerce certification cource :)
Every product should have a unique SKU if you use SKU. Else dont have any at all and use the node id as SKU.
Kind regards
Anders
is working on a reply...