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,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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user