Answer the question
In order to leave comments, you need to log in
How to recalculate the cart after applying the cart rules coupon?
Hello!
There is a slightly customized sale.order.ajax. Also, in his template, a basket is displayed to the heap. There is also a coupon entry field. The problem is that when using a product discount coupon (via CCatalogDiscountCoupon::SetCoupon() ) everything works fine. But with a coupon, there are no basket rules.
The component has the following code:
$couponsDB = CCatalogDiscountCoupon::GetList(array("ID" => "ASC"), array("COUPON" => $_POST['COUPON'], "ACTIVE" => "Y"));
if($couponItem = $couponsDB->Fetch()) {
CCatalogDiscountCoupon::SetCoupon($couponItem['COUPON']);
$arResult['DISCOUNT_COUPON'] = $couponItem['COUPON'];
} else {
CCatalogDiscountCoupon::ClearCoupon();
}
CCatalogDiscountCoupon::SetCoupon($_POST['COUPON'])
$arResult['DISCOUNT_COUPON'] = $_POST['COUPON'];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question