Page 1 of 1

OrderItemPriceDetail for price adjustment

Posted: Thu Feb 12, 2015 12:54 pm
by seohulu
We tried to implement a bus ticket system by using broadleafcommerce.

One feature of web app is to adjust of price (round trip price) of bus ticket when the user add a pair of round tickets to his shopping cart.

We already created a pricing workflow activity to identify if the pair of tickets in shopping cart is round-trip or not.
But we are confused to how to adjust the ticket price; if we change the price on OrderItem by using setPrice(), it seems like more problems will be triggered when user update the ticket quantity in shopping cart.Also for each orderItem with bigger quanity, some of them might have the adjusted price, some of them might not have the adjusted price.

We are thinking about to use OrderItemPriceDetail now , but my question is here: how to correctly use OrderItemPriceDetail to adjust the price of orderItem? Also . Say for a single orderItem with quantity 20, could we just adjust the price on 15 of those 20 items and leave the price of other 5 items unchanged?

Thanks in advance.

Re: OrderItemPriceDetail for price adjustment

Posted: Mon Feb 16, 2015 11:40 pm
by phillipuniverse
Yes. The original design of OrderItemPriceDetails was to support buy-one-get-one-free where you have an item with quantity 2 but 2 price details: 1 that costs $0 and one that costs the full price of the item.

Re: OrderItemPriceDetail for price adjustment

Posted: Mon Feb 23, 2015 1:04 am
by seohulu
Finally I solved the problem by extending my own offeractivity , which will scan the orderitems and loading the offer by using offercode and add offer to order.