Answer the question
In order to leave comments, you need to log in
How to check in catalog.section if at least one of the offers is available for purchase?
Good afternoon.
In the catalog.element template, checking for the availability of an item for purchase is defined as
if (isset($arResult['OFFERS']) && !empty($arResult['OFFERS'])) {
$canBuy = $arResult['OFFERS'][$arResult['OFFERS_SELECTED']]['CAN_BUY'];
}
else {
$canBuy = $arResult['CAN_BUY'];
}
echo $canBuy; // 1 или ничего
$canBuy = $arItem['JS_OFFERS'][$arItem['OFFERS_SELECTED']]['CAN_BUY'];
I don't quite understand why, but I don't think it works at all. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question