P
P
pavelmosin2020-09-28 18:11:00
1C-Bitrix
pavelmosin, 2020-09-28 18:11:00

Why doesn't Bitrix\Sale\DiscountCouponsManager work?

I get an empty array

use Bitrix\Main\Loader;
\Bitrix\Main\Loader::includeModule('sale');


$arCoupon = \Bitrix\Sale\DiscountCouponsManager::get(
$extMode = true,
$filter = array(),
$show = false,
$final = false
);


?>
<pre>
<? print_r( $arCoupon ); ?>
</pre>
<?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PetrPo, 2020-09-28
@pavelmosin

The \Bitrix\Sale\DiscountCouponsManager::get method returns applied coupons
Use \Bitrix\Sale\Internals\DiscountCouponTable::getList
As in your example, without filter, select, etc

$arCoupon = \Bitrix\Sale\Internals\DiscountCouponTable::getList()->fetchAll();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question