Files
vinoteca/local/components/jinove/order.done/templates/.default/template.php
T

55 lines
3.8 KiB
PHP

<?php
use Bitrix\Main\Localization\Loc;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
Loc::loadMessages(__FILE__);
$state = $arResult["STATE"];
$order = $arResult["ORDER"];
$text = static fn(string $key): string => htmlspecialcharsbx((string)Loc::getMessage($key));
$lead = $state === "pending" && !empty($order["CANCELLED"]) ? "VINO_DONE_LEAD_CANCEL" : "VINO_DONE_LEAD_" . strtoupper($state);
?>
<section class="vino-razdel-hero">
<div class="vino-wrap">
<?php \Jinove\Vinoteca\Breadcrumbs::show(array(array($arResult["TITLE"]))); ?>
<h1 class="vino-razdel-hero__title"><?= htmlspecialcharsbx($arResult["TITLE"]) ?></h1>
</div>
</section>
<section class="vino-done" data-done data-base="<?= htmlspecialcharsbx(SITE_DIR) ?>" data-text-fail="<?= $text("VINO_DONE_PAY_FAIL") ?>" data-text-busy="<?= $text("VINO_DONE_BUSY") ?>"<?= $state === "pending" && $arResult["AUTOPAY"] ? " data-autopay" : "" ?><?= $state !== "missing" ? ' data-id="' . (int)$order["ID"] . '" data-hash="' . htmlspecialcharsbx($order["HASH"]) . '"' : "" ?>>
<div class="vino-done__inner">
<p class="vino-done__lead"><?= $text($lead) ?></p>
<?php if ($state === "missing"): ?>
<a class="vino-btn" href="<?= htmlspecialcharsbx($arResult["CATALOG_URL"]) ?>"><?= $text("VINO_DONE_TO_CATALOG") ?></a>
<?php else: ?>
<p class="vino-done__number"><?= $text("VINO_DONE_NUMBER") ?>: <b class="vino-done__number-value"><?= htmlspecialcharsbx($order["NUMBER"]) ?></b></p>
<?php if ($state === "pending"): ?>
<div class="vino-done__pay">
<button class="vino-btn" type="button" data-done-pay><?= $text("VINO_DONE_PAY") ?></button>
<p class="vino-done__error" role="alert" data-done-error<?= $arResult["PAY_FAILED"] ? "" : " hidden" ?>><?= $arResult["PAY_FAILED"] ? $text("VINO_DONE_PAY_FAIL") : "" ?></p>
</div>
<?php endif; ?>
<div class="vino-done__grid">
<div class="vino-done__card">
<h2 class="vino-done__title"><?= $text("VINO_DONE_ITEMS") ?></h2>
<ul class="vino-done__items">
<?php foreach ($order["ITEMS"] as $item): ?>
<li class="vino-done__item"><span class="vino-done__item-name"><?= htmlspecialcharsbx($item["name"]) ?> <span class="vino-done__item-qty">&times; <?= (int)$item["quantity"] ?></span></span><span class="vino-done__item-sum"><?= htmlspecialcharsbx($item["sum"]) ?></span></li>
<?php endforeach; ?>
</ul>
<p class="vino-done__total"><span><?= $text("VINO_DONE_TOTAL") ?></span><span><?= htmlspecialcharsbx($order["TOTAL"]) ?></span></p>
</div>
<dl class="vino-done__card vino-done__facts">
<div class="vino-done__fact"><dt class="vino-done__fact-term"><?= $text("VINO_DONE_CONTACTS") ?></dt><dd class="vino-done__fact-value"><?= htmlspecialcharsbx($order["NAME"]) ?><br><?= htmlspecialcharsbx($order["PHONE"]) ?><br><?= htmlspecialcharsbx($order["EMAIL"]) ?></dd></div>
<div class="vino-done__fact"><dt class="vino-done__fact-term"><?= $text("VINO_DONE_PICKUP") ?></dt><dd class="vino-done__fact-value"><?= $text("VINO_DONE_PICKUP_TEXT") ?></dd></div>
<div class="vino-done__fact"><dt class="vino-done__fact-term"><?= $text("VINO_DONE_PAYMENT") ?></dt><dd class="vino-done__fact-value"><?= htmlspecialcharsbx($order["METHOD"]) ?></dd></div>
</dl>
</div>
<p class="vino-done__demo"><?= $text("VINO_DONE_DEMO") ?></p>
<a class="vino-btn vino-btn--outline" href="<?= htmlspecialcharsbx($arResult["CATALOG_URL"]) ?>"><?= $text("VINO_DONE_TO_CATALOG") ?></a>
<?php endif; ?>
</div>
</section>