cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

discount not included in total

Former Member
0 Likes
234

Hello,

I am looking at the OOTB store front and I am seeing the discount price not included in total. The total price showing without discount value.

Is there any setting that I need to configure to include the discounts part of total order value? or If there is no setting any one has any idea what class need modify to include the discounts part of total?

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Thanks for you response Nitesh.

is that Order discount apply is not OOTB? Do I need to make code changes to apply order level discount? I thought the discounts will apply part of total automatically.

In the DefaultCalculationService.java the discounts is set OOTB.

Thanks in advance.

Former Member
0 Likes

Hi Sasi,

  1. If its an order level discount, then you have to set the discounted value ($20) to the setGlobalDiscountValue() on cartModel.

  2. Then you have to save this cart model to give the order level discount ($20)

      List<DiscountValue> discountList = new ArrayList<DiscountValue>();
         
         final DiscountValue discountValue = new DiscountValue("code", 20.0 , true, "USD" );
         
         discountList.add(discountValue);
    
         cartService.getSessionCart().setGlobalDiscountValues(discountList);
    
         modelService.save(cartService.getSessionCart());
    
         modelService.refresh(cartService.getSessionCart());