Answer the question
In order to leave comments, you need to log in
How to get priority from the cart rule?
How to get priority from the cart rule? By the rule, you can create coupons. 2 hours poking around in the documentation, but found nothing. And in the information of the coupon (if you get through get()), no
Answer the question
In order to leave comments, you need to log in
I don't quite understand what you want to get, but try this:
if (\Bitrix\Main\Loader::includeModule('sale')) {
$order = \Bitrix\Sale\Order::load($orderId);
$appliedDiscount = $order->getDiscount()->getApplyResult(true);
$discounts = [];
foreach ($appliedDiscount['DISCOUNT_LIST'] as $discount) {
$discounts[] = $discount['REAL_DISCOUNT_ID'];
// Информация о примененной скидке
echo '<pre style="color: red;">', print_r($discount, true), '</pre>';
}
$appliedList = Bitrix\Sale\Internals\DiscountTable::getList([
'filter' => ['=ID' => $discounts]
])->fetchAll();
// Подробная информация о скидке
echo '<pre style="color: red;">', print_r($appliedList, true), '</pre>';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question