Skip to Content
author's profile photo Former Member
Former Member

Split Single Order/Cart Entry into multiple Order/Cart Entries of the same product based on Promotion applied

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 ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    Posted on May 05, 2016 at 05:45 PM

    Hi Ravi,

    There is no mechanism to do such splitting of order entries OOTB. You will have to custom implement it.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 06, 2016 at 06:00 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 06, 2016 at 03:55 PM

    Hi Ravi,

    You can use OOTB product level promotion 'Multibuy' for above requirement. Try it once.

    Regards, Rupesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 06, 2016 at 08:48 PM

    You can implement split logic in AddToCartMethodHook, after actual adding of an item to the cart.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 07, 2016 at 11:14 AM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.