1С-Битрикс
60
Вклад в тег
$basket = \Bitrix\Sale\Basket::loadItemsForFUser(
\CSaleBasket::GetBasketUserID(),
"s1"
);
$order = Bitrix\Sale\Order::create( "s1" , \Bitrix\Sale\Fuser::getId());
$order ->setPersonTypeId( 1 );
$order ->setBasket( $basket );
$discounts = $order ->getDiscount();
$res = $discounts ->getApplyResult();
foreach($res['COUPON_LIST'] as $cupo_n=>$ar_r){
...
тут проводим манипуляцую с купоном
...
}