AddEventHandler("main", "OnBeforeEventAdd", array("MyClass", "OnBeforeEventAddHandler"));
и проверить как будет оформляться заказ <?
if ($arParams["HIDE_COUPON"] != "Y")
{
?>
<div class="bx_ordercart_coupon">
<span><?=GetMessage("STB_COUPON_PROMT")?></span><input type="text" id="coupon" name="COUPON" value="" onchange="enterCoupon();"> <a class="bx_bt_button bx_big" href="javascript:void(0)" onclick="enterCoupon();" title="<?=GetMessage('SALE_COUPON_APPLY_TITLE'); ?>"><?=GetMessage('SALE_COUPON_APPLY'); ?></a>
</div><?
if (!empty($arResult['COUPON_LIST']))
{
foreach ($arResult['COUPON_LIST'] as $oneCoupon)
{
$couponClass = 'disabled';
switch ($oneCoupon['STATUS'])
{
case DiscountCouponsManager::STATUS_NOT_FOUND:
case DiscountCouponsManager::STATUS_FREEZE:
$couponClass = 'bad';
break;
case DiscountCouponsManager::STATUS_APPLYED:
$couponClass = 'good';
break;
}
?><div class="bx_ordercart_coupon"><input disabled readonly type="text" name="OLD_COUPON[]" value="<?=htmlspecialcharsbx($oneCoupon['COUPON']);?>" class="<? echo $couponClass; ?>"><span class="<? echo $couponClass; ?>" data-coupon="<? echo htmlspecialcharsbx($oneCoupon['COUPON']); ?>"></span><div class="bx_ordercart_coupon_notes"><?
if (isset($oneCoupon['CHECK_CODE_TEXT']))
{
echo (is_array($oneCoupon['CHECK_CODE_TEXT']) ? implode('<br>', $oneCoupon['CHECK_CODE_TEXT']) : $oneCoupon['CHECK_CODE_TEXT']);
}
?></div></div><?
}
unset($couponClass, $oneCoupon);
}
}
else
{
?> <?
}
Add2BasketByProductID(
$PRODUCT_ID,
$PRODUCT_COUNT,
false,
array("NAME" => "Размер", "VALUE" => $_POST["НАЗВАНИЕ_ПЕРЕМЕННОЙ_SELECT"])
);
как добавить выбранный размерБерёте данные из $_POST и сохраняете.
$arFilter = array(
"IBLOCK_ID" => 8,
"SECTION_ID" => 2208,
"INCLUDE_SUBSECTIONS" => "Y",
"!PROPERTY_OTHER_COLORS" => false
);
$res = CIBlockElement::GetList(Array(), $arFilter);
echo 'Товаров: '.$res->SelectedRowsCount();