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

This commit is contained in:
jimagie committed 2026-10-22 03:32:28 +05:00
commit f6ba0d2174
470 files changed
+26454

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
use Bitrix\Main\Context;
use Bitrix\Main\Localization\Loc;
use Jinove\Vinoteca\Cart;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
class JinoveCartComponent extends CBitrixComponent
{
public function executeComponent(): array
{
global $APPLICATION;
$APPLICATION->SetTitle(Loc::getMessage("VINO_CART_PAGE_TITLE"));
$APPLICATION->SetPageProperty("title", Loc::getMessage("VINO_CART_BROWSER_TITLE"));
$APPLICATION->SetPageProperty("description", Loc::getMessage("VINO_CART_PAGE_DESCRIPTION"));
$APPLICATION->SetPageProperty("vino_alternates", "N");
$APPLICATION->SetPageProperty("vino_schema", "N");
$APPLICATION->SetPageProperty("robots", "noindex, nofollow");
$basket = Cart::load();
$shareCode = (string)Context::getCurrent()->getRequest()->getQuery("share");
$shareItems = $basket !== null && $shareCode !== "" ? Cart::parseShare($shareCode) : [];
$this->arResult = [
"TITLE" => (string)Loc::getMessage("VINO_CART_PAGE_TITLE"),
"SHARED" => $shareItems ? Cart::shared($shareItems) : null,
"SHARE_REQUESTED" => $shareCode !== "",
"CART_URL" => SITE_DIR . "personal/cart/",
"CART" => $basket !== null ? Cart::view($basket) : ["count" => 0, "summary" => "", "items" => [], "base" => "", "discount" => "", "total" => "", "coupons" => []],
"CATALOG_URL" => SITE_DIR . "catalog/",
"CHECKOUT_URL" => SITE_DIR . "personal/order/",
"MAX_QUANTITY" => Cart::MAX_QUANTITY,
];
$this->includeComponentTemplate();
return $this->arResult;
}
}