Vinoteca: wine shop on 1C-Bitrix (module, template, components, pages)
This commit is contained in:
commit
0590195880
593 files changed
+27942
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user