How to get per item Discount?

Vote:
 

Epi commerce ver:10.2.5

Hi,

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 product.how can I get that thing.

Example:

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?

#193663
Jun 01, 2018 19:14
Vote:
 

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%?

#193664
Jun 01, 2018 20:04
Vote:
 

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

#193666
Jun 01, 2018 21:00
Vote:
 

What is an exact  formula quan?

#193667
Edited, Jun 01, 2018 21:03
Vote:
 

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

#193668
Jun 01, 2018 22:17
Vote:
 

Thank you quan.

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

#193670
Edited, Jun 02, 2018 7:40
Vote:
 

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

order.ApplyDiscounts() 

#193673
Jun 02, 2018 10:44
Vote:
 

Thank you Quan,

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

#193674
Jun 02, 2018 10:49
Vote:
 

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

#193676
Jun 02, 2018 11:39
Vote:
 

Thanks quan

#193677
Jun 02, 2018 11:52
Vote:
 

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,

#193844
Edited, Jun 05, 2018 20:03
Vote:
 

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

#193849
Jun 05, 2018 21:22
Vote:
 

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 variations.so 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,

#193850
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.