Files

61 lines
2.5 KiB
PHP

<?php
use Bitrix\Main\Localization\Loc;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
\Jinove\Vinoteca\Offers::refresh();
?>
<section class="vino-razdel-hero">
<div class="vino-wrap">
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array(Loc::getMessage("VINO_OFFERS_H1"), $arResult["FOLDER"]))); ?>
</div>
</section>
<?php
$offerId = $APPLICATION->IncludeComponent("bitrix:news.detail", "", array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"ELEMENT_ID" => $arResult["VARIABLES"]["ELEMENT_ID"] ?? "",
"ELEMENT_CODE" => $arResult["VARIABLES"]["ELEMENT_CODE"] ?? "",
"FIELD_CODE" => $arParams["DETAIL_FIELD_CODE"],
"PROPERTY_CODE" => $arParams["DETAIL_PROPERTY_CODE"],
"DETAIL_URL" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["detail"],
"CHECK_DATES" => $arParams["CHECK_DATES"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"SET_TITLE" => "N",
"SET_BROWSER_TITLE" => "N",
"SET_META_KEYWORDS" => "N",
"SET_META_DESCRIPTION" => "N",
"SET_LAST_MODIFIED" => "N",
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
"ADD_SECTIONS_CHAIN" => "N",
"ADD_ELEMENT_CHAIN" => "N",
"SET_CANONICAL_URL" => "N",
"SET_STATUS_404" => $arParams["SET_STATUS_404"],
"SHOW_404" => $arParams["SHOW_404"],
"FILE_404" => $arParams["FILE_404"],
"MESSAGE_404" => $arParams["MESSAGE_404"],
"USE_PERMISSIONS" => "N",
"DISPLAY_TOP_PAGER" => "N",
"DISPLAY_BOTTOM_PAGER" => "N",
), $component);
if (!$offerId) {
return;
}
$offer = \Jinove\Vinoteca\Offers::summary(\Jinove\Vinoteca\Offers::discountIdsOf((int)$offerId));
$offerPath = $arResult["FOLDER"] . $arResult["VARIABLES"]["ELEMENT_CODE"] . "/";
?>
<section class="vino-razdel-sec vino-offers-wines" id="vino-offers-wines">
<div class="vino-wrap">
<h2 class="vino-offers-wines__title"><?= Loc::getMessage("VINO_OFFERS_THIS_WINES") ?></h2>
<?php if ($offer["active"]): ?>
<?php $APPLICATION->IncludeComponent("bitrix:catalog.section", "vinoteca", \Jinove\Vinoteca\Offers::wineParams($offer["products"], $offer["sections"], $offerPath, $offerPath), $component); ?>
<?php else: ?>
<p class="vino-offers-wines__empty"><?= Loc::getMessage("VINO_OFFERS_ENDED") ?></p>
<?php endif; ?>
</div>
</section>
<?php \Jinove\Vinoteca\Offers::canonical($offerPath); ?>