KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: HappyHippo on February 07, 2018, 11:17:42 am

Title: Creating Promtion By API and set Order Total Discount Problem
Post by: HappyHippo on February 07, 2018, 11:17:42 am
Hi,
I am creating promotion using AdminPromotion and setting setOrderTotalCode("ot_total_discount");

AdminPromotion promotion = new AdminPromotion();
promotion.setName(getName());
promotion.setActive(true);
promotion.setOrderTotalCode("ot_total_discount");

On admin contol panel i can see the promotion created with correct promotion type but "Minimum Order Value", "Min total quantity" , "Min quantity for a product", "Discount Type" etc. field of Total Discount module are not set. 

How can i give these value at the time of creating promotion and attach these to the promotion through API?

Thank you very much in advance.
Title: Re: Creating Promtion By API and set Order Total Discount Problem
Post by: julie on February 07, 2018, 05:15:05 pm
Depending on the promotion being used, KonaKart allows you to define how the attributes of the promotion are interpreted. You need to take a look at custom\modules\src\com\konakartadmin\modules\ordertotal\totaldiscount\TotalDiscount.java to see how the custom attributes of the promotion object are mapped.

e.g. Minimum Order Value is mapped onto custom1
Title: Re: Creating Promtion By API and set Order Total Discount Problem
Post by: HappyHippo on February 08, 2018, 02:05:53 am
Got it. Thank you very much!