Korusol
8/14/2017 - 4:46 PM

#bitrix_d7 #bitrix Вытащить купоны из заказа

#bitrix_d7 #bitrix Вытащить купоны из заказа

CModule::IncludeModule("sale");

$couponList = \Bitrix\Sale\Internals\OrderCouponsTable::getList(array(
    'select' => ['COUPON'],
    'filter' => ['=ORDER_ID' => 93]
));

$coupons = [];

while ($coupon = $couponList->fetch())
{
    $coupons[] = $coupon['COUPON'];
}

$couponString =  implode(', ', $coupons );