Files
vinoteca/local/templates/jinove_wine/footer.php
T

186 lines
16 KiB
PHP

<?php
use Bitrix\Main\Localization\Loc;
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
Loc::loadMessages(__FILE__);
$jwContacts = \Jinove\Vinoteca\Config::contacts();
$jwTabCatalog = \Jinove\Vinoteca\Navigation::isActive("/catalog/");
$jwTabFavorites = \Jinove\Vinoteca\Navigation::isActive("/personal/favorites/");
$jwTabCart = \Jinove\Vinoteca\Navigation::isActive("/personal/cart/");
$jwTabAccount = \Jinove\Vinoteca\Navigation::isActive("/personal/", true) || \Jinove\Vinoteca\Navigation::isActive("/login/", true);
$jwConsent = function (string $buttonKey): string {
return '<label class="vino-consent vino-consent--sm"><input class="vino-consent__checkbox" type="checkbox" name="consent" value="1" required><span class="vino-consent__text">'
. Loc::getMessage("VINO_FOOTER_CONSENT", array("#BUTTON#" => Loc::getMessage($buttonKey), "#URL#" => SITE_DIR . "consent/", "#PRIVACY_URL#" => SITE_DIR . "privacy/"))
. '</span></label>';
};
?>
</main>
<?php
?>
<nav class="vino-tabbar" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_MENU")) ?>">
<a class="vino-tabbar__item<?= $jwTabCatalog ? " vino-tabbar__item--active" : "" ?>"<?= $jwTabCatalog ? ' aria-current="page"' : "" ?> href="<?= SITE_DIR ?>catalog/"><svg class="vino-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 3h8l-1 6a3 3 0 0 1-6 0Z"></path><path d="M12 12v8"></path><path d="M8.5 21h7"></path></svg><span><?= Loc::getMessage("VINO_FOOTER_TAB_CATALOG") ?></span></a>
<a class="vino-tabbar__item<?= $jwTabFavorites ? " vino-tabbar__item--active" : "" ?>"<?= $jwTabFavorites ? ' aria-current="page"' : "" ?> href="<?= SITE_DIR ?>personal/favorites/"><svg class="vino-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19 14c1.5-1.5 3-3.2 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.8 0-3 .5-4.5 2-1.5-1.5-2.7-2-4.5-2A5.5 5.5 0 0 0 2 8.5C2 10.8 3.5 12.5 5 14l7 7Z"></path></svg><span class="vino-act__count vino-tabbar__count" data-fav-count hidden></span><span><?= Loc::getMessage("VINO_FOOTER_TAB_FAVORITES") ?></span></a>
<a class="vino-tabbar__item<?= $jwTabCart ? " vino-tabbar__item--active" : "" ?>"<?= $jwTabCart ? ' aria-current="page"' : "" ?> href="<?= SITE_DIR ?>personal/cart/" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_TAB_CART")) ?>"><svg class="vino-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="9" cy="20" r="1.3"></circle><circle cx="18" cy="20" r="1.3"></circle><path d="M2 3h2.2l2.3 12.1a1.5 1.5 0 0 0 1.5 1.2h9.6a1.5 1.5 0 0 0 1.5-1.2L21 6.5H5.3"></path></svg><span class="vino-act__count vino-tabbar__count" aria-hidden="true" data-cart-count hidden></span><span aria-hidden="true"><?= Loc::getMessage("VINO_FOOTER_TAB_CART") ?></span></a>
<a class="vino-tabbar__item<?= $jwTabAccount ? " vino-tabbar__item--active" : "" ?>"<?= $jwTabAccount ? ' aria-current="page"' : "" ?> href="<?= htmlspecialcharsbx(\Jinove\Vinoteca\Account::url()) ?>"><svg class="vino-icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="7.5" r="3.5"></circle><path d="M5 20a7 7 0 0 1 14 0"></path></svg><span><?= htmlspecialcharsbx(\Jinove\Vinoteca\Account::label("VINO_FOOTER_TAB_ACCOUNT", "VINO_FOOTER_TAB_LOGIN")) ?></span></a>
</nav>
<div class="vino-age" data-age-gate data-exit="<?= htmlspecialcharsbx(\Jinove\Vinoteca\Config::ageExitUrl()) ?>" hidden>
<div class="vino-age__card" role="dialog" aria-modal="true" aria-labelledby="vino-age-title" aria-describedby="vino-age-text" tabindex="-1">
<div class="vino-logo vino-age__icon vino-age__logo" aria-hidden="true">
<img class="vino-logo__icon" src="<?= SITE_TEMPLATE_PATH ?>/assets/brand/vinoteca-icon.svg?v=5" width="56" height="56" alt="" decoding="async">
<span class="vino-logo__name">Vinoteca</span>
</div>
<h2 class="vino-age__title" id="vino-age-title"><?= Loc::getMessage("VINO_FOOTER_AGE_TITLE") ?></h2>
<p class="vino-age__text" id="vino-age-text"><?= Loc::getMessage("VINO_FOOTER_AGE_TEXT") ?></p>
<div class="vino-age__actions">
<button class="vino-age__btn vino-age__btn--yes" type="button" data-age-yes><?= Loc::getMessage("VINO_FOOTER_AGE_YES") ?></button>
<button class="vino-age__btn vino-age__btn--no" type="button" data-age-no><?= Loc::getMessage("VINO_FOOTER_AGE_NO") ?></button>
</div>
<p class="vino-age__legal"><?= Loc::getMessage("VINO_FOOTER_HEALTH_WARNING") ?></p>
</div>
</div>
<dialog class="vino-modal" data-sommelier aria-labelledby="vino-sommelier-title">
<div class="vino-modal__dialog">
<button type="button" class="vino-modal__close" data-sommelier-close aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_CLOSE")) ?>"><svg class="vino-modal__close-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"></path></svg></button>
<div data-sommelier-body>
<p class="vino-modal__kicker"><?= Loc::getMessage("VINO_FOOTER_SOMMELIER_KICKER") ?></p>
<h2 class="vino-modal__title" id="vino-sommelier-title"><?= Loc::getMessage("VINO_FOOTER_SOMMELIER_TITLE") ?></h2>
<p class="vino-modal__lead"><?= Loc::getMessage("VINO_FOOTER_SOMMELIER_LEAD") ?></p>
<form class="vino-modal__form" method="post" novalidate data-sommelier-form>
<input type="text" name="website" class="vino-hp" tabindex="-1" autocomplete="off" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_HONEYPOT")) ?>" aria-hidden="true">
<input class="vino-inp" type="text" name="name" placeholder="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_NAME")) ?>" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_NAME")) ?>" autocomplete="name" maxlength="100" required>
<input class="vino-inp" type="tel" name="phone" placeholder="+7 912 345 67 89" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_PHONE")) ?>" autocomplete="tel" inputmode="tel" required data-phone-code="7" data-phone-digits="10" data-phone-groups="3,3,2,2">
<textarea class="vino-inp vino-txt" name="message" placeholder="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_QUESTION")) ?>" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_QUESTION")) ?>" maxlength="2000" required></textarea>
<altcha-widget name="altcha" challenge="/bitrix/services/main/ajax.php?action=jinove:vinoteca.lead.challenge" auto="onload" display="invisible"></altcha-widget>
<?= $jwConsent("VINO_FOOTER_SEND") ?>
<p class="vino-modal__err" role="alert" data-sommelier-err hidden></p>
<button class="vino-btn" type="submit"><?= Loc::getMessage("VINO_FOOTER_SEND") ?></button>
</form>
</div>
<div class="vino-modal__done" data-sommelier-done tabindex="-1" hidden>
<p class="vino-modal__kicker"><?= Loc::getMessage("VINO_FOOTER_SOMMELIER_SENT") ?></p>
<p class="vino-modal__title"><?= Loc::getMessage("VINO_FOOTER_THANKS") ?></p>
<p class="vino-modal__lead"><?= Loc::getMessage("VINO_FOOTER_SOMMELIER_DONE", array("#PHONE#" => '<span class="vino-modal__contact" data-sommelier-phone></span>')) ?></p>
<button type="button" class="vino-btn vino-btn--outline" data-sommelier-close><?= Loc::getMessage("VINO_FOOTER_CLOSE") ?></button>
</div>
</div>
</dialog>
<div class="vino-cookie" data-cookie-bar hidden>
<div class="vino-cookie__inner">
<p class="vino-cookie__text"><?= Loc::getMessage("VINO_FOOTER_COOKIE", array("#LINK#" => '<a class="vino-cookie__link" href="' . SITE_DIR . 'privacy/">' . Loc::getMessage("VINO_FOOTER_PRIVACY_LINK") . '</a>')) ?></p>
<div class="vino-cookie__actions">
<button type="button" class="vino-btn vino-btn--sm vino-cookie__ok" data-cookie-ok><?= Loc::getMessage("VINO_FOOTER_ACCEPT") ?></button>
<button type="button" class="vino-btn vino-btn--sm vino-btn--outline vino-cookie__ok" data-cookie-decline><?= Loc::getMessage("VINO_FOOTER_DECLINE") ?></button>
</div>
</div>
</div>
<footer class="vino-footer">
<?php if (\Jinove\Vinoteca\Navigation::isActive("/", true)): ?>
<div class="vino-footer__news">
<div class="vino-footer__news-text">
<h2 class="vino-footer__title vino-footer__title--news"><?= Loc::getMessage("VINO_FOOTER_NEWS_TITLE") ?></h2>
<p class="vino-footer__lead"><?= Loc::getMessage("VINO_FOOTER_NEWS_TEXT") ?></p>
</div>
<div class="vino-footer__news-form">
<form class="vino-subscribe" id="subscribe" method="post" novalidate data-subscribe data-ok="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_SUBSCRIBED")) ?>" data-error="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_EMAIL_ERROR")) ?>">
<input type="text" name="website" class="vino-hp" tabindex="-1" autocomplete="off" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_HONEYPOT")) ?>" aria-hidden="true">
<altcha-widget name="altcha" challenge="/bitrix/services/main/ajax.php?action=jinove:vinoteca.lead.challenge" auto="onload" display="invisible"></altcha-widget>
<div class="vino-subscribe__row">
<input class="vino-inp" type="email" name="email" placeholder="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_EMAIL")) ?>" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_EMAIL")) ?>" required>
<button class="vino-btn vino-btn--sm vino-btn--outline" type="submit"><?= Loc::getMessage("VINO_FOOTER_SUBSCRIBE") ?></button>
</div>
<?= $jwConsent("VINO_FOOTER_SUBSCRIBE") ?>
<p class="vino-sub-msg vino-sub-msg--err" role="alert" data-subscribe-err hidden></p>
</form>
<p class="vino-sub-msg" role="status" data-subscribe-msg hidden></p>
</div>
</div>
<?php endif; ?>
<div class="vino-footer__grid">
<div class="vino-footer__col vino-footer__col--wide vino-footer__brand">
<a class="vino-logo vino-logo--footer" href="<?= SITE_DIR ?>" aria-label="Vinoteca">
<img class="vino-icon vino-logo__icon" src="<?= SITE_TEMPLATE_PATH ?>/assets/brand/vinoteca-icon.svg?v=5" width="56" height="56" alt="" aria-hidden="true" loading="lazy" decoding="async">
<span class="vino-logo__name" aria-hidden="true">Vinoteca</span>
</a>
<p class="vino-footer__about"><?= Loc::getMessage("VINO_FOOTER_ABOUT") ?></p>
</div>
<div class="vino-footer__col">
<h2 class="vino-footer__title"><?= Loc::getMessage("VINO_FOOTER_CATALOG") ?></h2>
<?php $APPLICATION->IncludeComponent(
"bitrix:menu", "vinoteca_footer", array(
"ROOT_MENU_TYPE" => "catalog",
"MENU_CACHE_TYPE" => "N",
"MAX_LEVEL" => "1",
"USE_EXT" => "Y",
"DELAY" => "N",
"ALLOW_MULTI_SELECT" => "N",
),
false
); ?>
</div>
<div class="vino-footer__col">
<h2 class="vino-footer__title"><?= Loc::getMessage("VINO_FOOTER_VINOTECA") ?></h2>
<?php $APPLICATION->IncludeComponent(
"bitrix:menu", "vinoteca_footer", array(
"ROOT_MENU_TYPE" => "bottom",
"MENU_CACHE_TYPE" => "A",
"MENU_CACHE_TIME" => "3600",
"MENU_CACHE_USE_GROUPS" => "Y",
"MAX_LEVEL" => "1",
"USE_EXT" => "N",
"DELAY" => "N",
"ALLOW_MULTI_SELECT" => "N",
),
false
); ?>
</div>
<div class="vino-footer__col vino-footer__col--wide">
<h2 class="vino-footer__title"><?= Loc::getMessage("VINO_FOOTER_CONTACTS") ?></h2>
<ul class="vino-footer__list">
<li class="vino-footer__item"><a class="vino-footer__phone" href="tel:<?= htmlspecialcharsbx($jwContacts["phone"]) ?>"><?= htmlspecialcharsbx($jwContacts["phoneLabel"]) ?></a></li>
<li class="vino-footer__item"><a class="vino-footer__link" href="mailto:<?= htmlspecialcharsbx($jwContacts["email"]) ?>"><?= htmlspecialcharsbx($jwContacts["email"]) ?></a></li>
<li class="vino-footer__item"><?= Loc::getMessage("VINO_FOOTER_ADDRESS_FORMAT", array("#CITY#" => Loc::getMessage("VINO_FOOTER_LD_CITY"), "#STREET#" => Loc::getMessage("VINO_FOOTER_LD_STREET"))) ?></li>
</ul>
<a class="vino-footer__tg" href="<?= htmlspecialcharsbx($jwContacts["telegram"]) ?>" target="_blank" rel="noopener" aria-label="Telegram" title="Telegram">
<svg class="vino-footer__tg-icon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"/></svg>
</a>
</div>
</div>
<div class="vino-footer__bottom">
<div class="vino-footer__legal">
<span>© <?= date("Y") ?> Vinoteca</span>
<span><b class="vino-footer__age">18+</b> <?= Loc::getMessage("VINO_FOOTER_HEALTH_WARNING_SHORT") ?></span>
</div>
<nav class="vino-footer__docs" aria-label="<?= htmlspecialcharsbx(Loc::getMessage("VINO_FOOTER_DOCUMENTS")) ?>">
<a class="vino-footer__doc" href="<?= SITE_DIR ?>privacy/"><?= Loc::getMessage("VINO_FOOTER_PRIVACY") ?></a>
<a class="vino-footer__doc" href="<?= SITE_DIR ?>consent/"><?= Loc::getMessage("VINO_FOOTER_CONSENT_DOC") ?></a>
<button type="button" class="vino-footer__doc vino-footer__doc--button" data-cookie-settings><?= Loc::getMessage("VINO_FOOTER_CONSENT_SETTINGS") ?></button>
</nav>
</div>
</footer>
<script type="application/json" id="vino-config"><?= json_encode(array(
"siteDir" => SITE_DIR,
"cartMax" => \Jinove\Vinoteca\Cart::MAX_QUANTITY,
"compareLimit" => \Jinove\Vinoteca\Catalog\Comparison::MAX,
"altcha" => SITE_TEMPLATE_PATH . "/assets/vendor/altcha/altcha.min.js?v=3.2.4",
"text" => array(
"compareAdd" => Loc::getMessage("VINO_FOOTER_JS_COMPARE_ADD"),
"compareRemove" => Loc::getMessage("VINO_FOOTER_JS_COMPARE_REMOVE"),
"compareMax" => Loc::getMessage("VINO_FOOTER_JS_COMPARE_MAX"),
"compareOpen" => Loc::getMessage("VINO_FOOTER_JS_COMPARE_OPEN"),
"fail" => Loc::getMessage("VINO_FOOTER_JS_FAIL"),
"phone" => Loc::getMessage("VINO_FOOTER_JS_PHONE"),
"consent" => Loc::getMessage("VINO_FOOTER_JS_CONSENT"),
"empty" => array("", Loc::getMessage("VINO_FOOTER_JS_EMPTY_1"), Loc::getMessage("VINO_FOOTER_JS_EMPTY_2"), Loc::getMessage("VINO_FOOTER_JS_EMPTY_3"), Loc::getMessage("VINO_FOOTER_JS_EMPTY_4"), Loc::getMessage("VINO_FOOTER_JS_EMPTY_5"), Loc::getMessage("VINO_FOOTER_JS_EMPTY_6"), Loc::getMessage("VINO_FOOTER_JS_EMPTY_7")),
),
), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
<?php if ($APPLICATION->GetPageProperty("vino_schema") !== "N") : ?>
<script type="application/ld+json"><?= json_encode(\Jinove\Vinoteca\StoreSchema::graph($jwContacts, Loc::getMessage("VINO_FOOTER_LD_DESCRIPTION"), Loc::getMessage("VINO_FOOTER_LD_STREET"), Loc::getMessage("VINO_FOOTER_LD_CITY")), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP) ?></script>
<?php endif; ?>
</body>
</html>