$conn->rollbackTransaction(); $adminList->AddUpdateError(implode('<br>', $result->getErrorMessages()), $couponID); } unset($result); } unset($fields, $couponID); Internals\DiscountCouponTable::enableCheckCouponsUse(); } } if (!$readOnly && ($listID = $adminList->GroupAction())) { $checkUseCoupons = ($_REQUEST['action'] == 'delete'); $discountList = array(); Internals\DiscountCouponTable::clearDiscountCheckList(); if ($_REQUEST['action_target'] == 'selected') { $listID = array(); $couponIterator = Internals\DiscountCouponTable::getList(array( 'select' => array('ID', 'DISCOUNT_ID'), 'filter' => $filter )); while ($coupon = $couponIterator->fetch()) { $listID[] = $coupon['ID']; if ($checkUseCoupons) $discountList[$coupon['DISCOUNT_ID']] = true; } }