Author Topic: Creating Promtion By API and set Order Total Discount Problem  (Read 430 times)

HappyHippo

  • Jr. Member
  • **
  • Posts: 22
  • Watch your motives before God;
    • View Profile
Creating Promtion By API and set Order Total Discount Problem
« on: February 07, 2018, 06: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.

julie

  • Administrator
  • Hero Member
  • *****
  • Posts: 537
    • View Profile
    • KonaKart
Re: Creating Promtion By API and set Order Total Discount Problem
« Reply #1 on: February 07, 2018, 12: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

HappyHippo

  • Jr. Member
  • **
  • Posts: 22
  • Watch your motives before God;
    • View Profile
Re: Creating Promtion By API and set Order Total Discount Problem
« Reply #2 on: February 07, 2018, 09:05:53 PM »
Got it. Thank you very much!