Vinoteca: модуль, шаблон и компоненты интернет-магазина вина на 1С-Битрикс

This commit is contained in:
jimagie committed 2026-10-22 19:28:52 +05:00
commit bb7d8af290
469 files changed
+26426

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
use Bitrix\Main\Localization\Loc;
use Jinove\Vinoteca\Cart;
use Jinove\Vinoteca\Checkout;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
class JinoveOrderComponent extends CBitrixComponent
{
public function executeComponent(): array
{
global $APPLICATION;
$APPLICATION->SetTitle(Loc::getMessage("VINO_ORDER_PAGE_TITLE"));
$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_ORDER_BROWSER_TITLE"));
$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_ORDER_PAGE_DESCRIPTION"));
$APPLICATION->SetPageProperty("vino_alternates", "N");
$APPLICATION->SetPageProperty("vino_schema", "N");
$APPLICATION->SetPageProperty("robots", "noindex, nofollow");
Loc::loadMessages($_SERVER["DOCUMENT_ROOT"] . SITE_TEMPLATE_PATH . "/footer.php");
$basket = Cart::load();
$cart = $basket !== null ? Cart::view($basket) : null;
$this->arResult = [
"TITLE" => (string)Loc::getMessage("VINO_ORDER_PAGE_TITLE"),
"CART" => $cart !== null && array_filter($cart["items"], static fn(array $item): bool => $item["available"]) ? $cart : null,
"METHODS" => Checkout::methods(),
"CART_URL" => SITE_DIR . "personal/cart/",
"CATALOG_URL" => SITE_DIR . "catalog/",
];
$this->includeComponentTemplate();
return $this->arResult;
}
}