SaaS CMS has officially launched! Learn more now.

LineItemId no longer unique per cart?


We recently updated Commerce from 13.8.0 to 13.25.0

Has there been a change that LineItemId is no longer unique per cart? I see that if I add line items they get get id, -1, -2, -3 etc but if I remove the first line item with id -1 and add another item that item gets -2 as the id. This results in 2 line items having the same id.

I also tried this in the latest Quicksilver master, 13.26.0 and I see the same thing here. We have some logic on the site that expects the LineItemId to be unique per cart. Do we have to change this or is this a bug?

Edited, Nov 19, 2020 9:49

I have asked COmmerce team to look into this. Probably a bug. thanks for bringing this into our attention.

Nov 19, 2020 11:52
Stian - Nov 20, 2020 8:31
Thank you. Do you have any updates on this?
Quan Mai - Nov 20, 2020 8:59
Commerce team will look into this. I have no further update currently unfortunately

Running 13.25.0

I'm experiencing the same issue.

I found out while debugging a custom promotion that was acting strange: the wrong item gets removed from the shipment in PromotionExcludedCatalogItemHandler.cs, when a promotion with a product exclusion is evaluated.

My analysis: The code uses the LineItemId from the exclusion map to find and remove LineItems in the shipment, but since the IDs are duplicate like Stian explained, the wrong LineItem is removed. The item in the exclusion map (which was supposed to be removed from the shipment) is then re-added to the shipment after the evaluation in RestoreItems() in PromotionExcludedCatalogItemHandler.cs resulting in a cart that misses an item and instead has another item duplicated.

Nov 30, 2020 10:40

This will be fixed in Commerce 13.27, releasing in near future 

Dec 01, 2020 13:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.