Try our conversational search powered by Generative AI!

Need to get Promotions (Gifts) for relevant product item

Vote:
 

Hi All,

I have requirement to dispaly a message in cart if gift item quantity is 0 for relevant promotion item. We are using Epi Promoengine  to calculate gift promotions and if gift item quantity is 0, promoengine will remove it from the cart.

So in this case we dont know what is the relevant gift item attached to selected promo product item, hence we cant decide to show the message (eg: You cant have the gift item due to the insufficient stock)

We would like to know is tehre a way to get applied promotions for a particular product item, if so how are could we do that?

Please help me to solve this issue?

Thank you.

#203897
May 10, 2019 1:00
Vote:
 
var result = promotionEngine.Evaluate(entryReference, market, currency, RequestFulfillmentStatus.Fulfilled | RequestFulfillmentStatus.PartiallyFulfilled);

Should tell you all promotions that are applicable to a specific entry, filter those to find the gift ones. Be warned that it isn't cheap to run that for every line in your cart.

A better solution would be to add partially fulfilled rewards to your actual call when you apply the promotions to your cart:

var result = promotionEngine.Run(cart, new PromotionEngineSettings { RequestedStatuses = RequestFulfillmentStatus.Fulfilled | RequestFulfillmentStatus.PartiallyFulfilled});

#203910
May 10, 2019 14:27
* 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.