Try our conversational search powered by Generative AI!

How to get per item Discount?


Epi commerce ver:10.2.5


i am using epi default discount type - "Buy Products for Discount on All Selections Buy at least X items, get discount on all."

In our site orders are maintained 3rd party ERP site. So I want to send the total percentage applied to the single can I get that thing.


2 discounts are applied to the same product(10% and 20%) so the total is not a 30% exactly it is a 28%. So how can i get that in epi or else?

Jun 01, 2018 19:14

The promotions are appiled on the result of previously applied promotions. So if you have two promotions which give 10% and 20%, the final discount will be 100% - (90%x80%) = 28%. So I'm not sure what you want - 30 or 28%?

Jun 01, 2018 20:04

I want that 28%.I will send with order.

Jun 01, 2018 21:00

What is an exact  formula quan?

Edited, Jun 01, 2018 21:03

Not sure I understand what you want, but let me just guess here. After calling ApplyDiscounts to apply the promotion, you can just look into order.GetFirstForm().Discounts, which contains the information about promotions applied. You can also look into each lineitem because they contains lineitem-level discount and order-level discount

Jun 01, 2018 22:17

Thank you quan.

Can u please give code for apply discount.i am using item discount type.commerce ver10.2.5

Edited, Jun 02, 2018 7:40

10.2.5 is actually quite old and I can't remember if it was in there, but you can try the IOrderGroup extension method


Jun 02, 2018 10:44

Thank you Quan,

Actually, I am using " promotionEngine.Run(lineitems)" .This is same as order.ApplyDiscounts()  or else.Which one is better.

Jun 02, 2018 10:49

ApplyDiscounts uses IPromotionEngine.Run internally so nothing is clearly better. It is just more convenient

Jun 02, 2018 11:39

Thanks quan

Jun 02, 2018 11:52

Hi Quan,

I have a doubt in epi discount calculation.

My product price - $0.98

discount - 20%

promotion price- 0.78(but exactly 0.784)

what is type conversion using in epi or just cut down after two decimal points? please reply asap.

because I will only send promotion percentage to ERP site for place order.ERP Promotion price is showing like below one. I want to intimate  ERP what type of conversion to be used in price.

ERP promotion price - 0.784

Advance thank you,

Edited, Jun 05, 2018 20:03

I can say that rounding is ... complicated. We are looking into this, but right now it might be difficult to change that default rounding.

Jun 05, 2018 21:22

Thank you quan,

Can you pls tell me right now what type of rounding mechanism used in epi.because for my epi end and erp(3rd party order management) end price have some i will tell erp side just do rounding after price percentage calculation.before tell them I want to know what type used in epi.

Advance thank you,

Jun 06, 2018 5:11
* 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.