Page 1 of 1

Don't update quantity on cart for same sku

Posted: Thu Mar 14, 2013 5:42 am
by denis
Hi,

I'm facing a problem when you add several times a sku on cart the quantity is updated (normal case).

My problem is that i have a product type SUBSCRIPTION which have a sku for each modality (DAY, MONTH, YEAR) and several configurable options. One order item is linked to a Subscription.

When i add a sku (MONTH) with option "color" for instance i create an order item with the sku price and additional fees for options selected and the subscription.

If i add a new subscription with same modality (so the same sku) instead of create a new order item, the quantity of the first order item is updated to 2 (because of the method gatherCart into OrderItemMergeService). Is there a way to not update the quantity and create the new order item?

Thanks in advance for your help

Re: Don't update quantity on cart for same sku

Posted: Thu Mar 14, 2013 9:24 am
by phillipuniverse
What version of Broadleaf are you guys on again? You might be able to override the buildIdentifier method in OrderItemMergeService (provide your subclass for the blOrderItemMergeService bean). There are some docs on this in the OrderItemMergeService interface on how this works; seems like it might suit your case. You might override this to build a string that considers the modality (which I assume is a property on Sku).

Re: Don't update quantity on cart for same sku

Posted: Thu Mar 14, 2013 1:45 pm
by denis
Hi Phillip,

We are on BLC 2.2.1-SNAPSHOT, i will try ASAP to change the buildidentifier method. Thanks for your help!

Re: Don't update quantity on cart for same sku

Posted: Fri Mar 15, 2013 4:43 am
by denis
It works perfectly, thanks again!