I need to split single order entry into multiple order entries based on Promotions applied. For eg :- Suppose there is a Volume Quota Threshold of 1000 litres upto which customers are provided a discount of 5%. Suppose a customer places an order of 1500 litres of Product A. Thus, customer is eligible for a discount of 5% on Product A for first 1000 litres and he will be charged at the normal rate on next 500 litres. Before applying promotions, there was a single order entry in the cart for Product A. After promotion is applied, the single order entry or line entry of Product A needs to be divided in two line entries with same Product A but different quantities and at different rates or prices. Thus, how do we achieve to split a single cart entry into multiple cart entries based on our promotions logic ? Is there some OOTB way out for this ? If not, then how is single cart entry divided into muliple cart entries ?
Hi Ravi,
There is no mechanism to do such splitting of order entries OOTB. You will have to custom implement it.
Thanx Charles for the suggestion. So, the custom way to do the same may be to create a new itemtype PromotionalLineEntry extending the AbstractOrderEntry. Now, we can add two new attributes - PromotionalLineEntry(as our single line entry can be divided into 2 line entries ie non promotional and promotional) and isPromoted(boolean type) in the AbstractOrderEntry. Suppose a Line Entry L1 is divided into L1.1 and L1.2, where L1.2 is the promotional line entry, and "isPromoted" attribute in the AbstractOrderEntry indicates whether a line item is divided into Promotional and NonPromotional line entries. This is what I have thought of as of now, please do let me know if there is a better custom way/logic to do the same.
Hi Rupesh,
Our requirement is different. We have different promotion rules which provide discount on some quantity part of the already added say Product A. Thus, we need to split this Product A into two line entries ie promotional line entry and non promotional line entry. Thus, we have created our custom promotions extending ProductPromotions and applied our custom logic to decide the coressponding promotional rule to our line entry added in the cart. So, I guess 'MultiBuy' may not fulfill our requirement. Thanx for the suggestion.
Regards,
Ravi
Add a comment