js css
This commit is contained in:
@@ -118,7 +118,7 @@ try {
|
||||
}
|
||||
</style>
|
||||
<meta name="theme-color" content="#173d2c">
|
||||
<link rel="stylesheet" href="/assets/css/app.css">
|
||||
<link rel="stylesheet" href="<?= e(versioned_asset('/assets/css/app.css')) ?>">
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-topbar">
|
||||
|
||||
@@ -6,6 +6,7 @@ declare(strict_types=1);
|
||||
/** @var array<int, array<string, mixed>> $categories */
|
||||
/** @var array<int, array<string, mixed>> $catalogProducts */
|
||||
/** @var array<int, array<string, mixed>> $popularProducts */
|
||||
/** @var array<int, array<string, mixed>> $homeCatalogSections */
|
||||
/** @var array<string, mixed> $settings */
|
||||
/** @var string|null $notice */
|
||||
/** @var string $buildVersion */
|
||||
@@ -230,6 +231,104 @@ $arrivalDate = $lastArrival->format('j') . ' ' . $months[(int) $lastArrival->for
|
||||
<div class="status-box danger"><?= e($notice) ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<section class="home-catalog-showcase" aria-label="Витрина каталога Рыбсток">
|
||||
<div class="home-catalog-heading">
|
||||
<div>
|
||||
<p class="eyebrow">Каталог продукции</p>
|
||||
<h2>Подборки по категориям</h2>
|
||||
</div>
|
||||
<a class="subtle-link" href="/catalog">Весь каталог</a>
|
||||
</div>
|
||||
|
||||
<?php if (($homeCatalogSections ?? []) === []): ?>
|
||||
<div class="panel">
|
||||
<p class="muted">После наполнения каталога товары появятся здесь по категориям.</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php $wishlistRequestRendered = false; ?>
|
||||
<?php foreach ($homeCatalogSections as $section): ?>
|
||||
<?php
|
||||
$sectionProducts = $section['products'] ?? [];
|
||||
if ($sectionProducts === []) {
|
||||
continue;
|
||||
}
|
||||
$sectionKind = (string) ($section['kind'] ?? 'category');
|
||||
?>
|
||||
<?php if (!$wishlistRequestRendered && ($section['key'] ?? '') === 'myaso'): ?>
|
||||
<?php require base_path('views/partials/wishlist-request-panel.php'); ?>
|
||||
<?php $wishlistRequestRendered = true; ?>
|
||||
<?php endif; ?>
|
||||
<section class="home-product-section is-<?= e($sectionKind) ?>" id="home-<?= e((string) ($section['key'] ?? 'section')) ?>">
|
||||
<div class="home-product-section-head">
|
||||
<h3><?= e((string) ($section['title'] ?? 'Категория')) ?></h3>
|
||||
<div class="home-product-section-actions">
|
||||
<?php if (!empty($section['url'])): ?>
|
||||
<a href="<?= e((string) $section['url']) ?>">Показать <?= e((string) ($section['count'] ?? count($sectionProducts))) ?> товаров</a>
|
||||
<?php endif; ?>
|
||||
<div class="home-strip-controls" aria-label="Прокрутка подборки">
|
||||
<button type="button" data-home-strip-prev aria-label="Назад">←</button>
|
||||
<button type="button" data-home-strip-next aria-label="Вперед">→</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="home-products-strip" aria-label="<?= e((string) ($section['title'] ?? 'Категория')) ?>">
|
||||
<?php foreach ($sectionProducts as $product): ?>
|
||||
<?php require base_path('views/partials/product-card.php'); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if (($section['key'] ?? '') === 'frukty-ovoschi-yagody-griby'): ?>
|
||||
<section class="home-delivery-separator" aria-label="Расчет доставки">
|
||||
<div>
|
||||
<p class="eyebrow">Доставка и самовывоз</p>
|
||||
<h3>Рассчитаем доставку до подъезда и подъем отдельно</h3>
|
||||
<p>Внутри МКАД бесплатно от <?= e((string) ($settings['inside_mkad_free_from'] ?? '5000')) ?> руб. За МКАД бесплатная доставка от 10000 руб. до 10 км, дальше сумма бесплатной доставки зависит от расстояния.</p>
|
||||
</div>
|
||||
<form class="home-delivery-mini" action="/delivery" method="get">
|
||||
<label>
|
||||
<span>Сумма заказа</span>
|
||||
<input type="number" name="amount" min="0" step="100" value="5000">
|
||||
</label>
|
||||
<label>
|
||||
<span>Получение</span>
|
||||
<select name="method">
|
||||
<option value="pickup">Самовывоз</option>
|
||||
<option value="inside" selected>Доставка внутри МКАД</option>
|
||||
<option value="outside">Доставка за МКАД</option>
|
||||
</select>
|
||||
</label>
|
||||
<button class="primary-button" type="submit">Открыть расчет</button>
|
||||
</form>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php if (!$wishlistRequestRendered): ?>
|
||||
<?php require base_path('views/partials/wishlist-request-panel.php'); ?>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
document.querySelectorAll('[data-home-strip-prev], [data-home-strip-next]').forEach((button) => {
|
||||
button.addEventListener('click', () => {
|
||||
const section = button.closest('.home-product-section');
|
||||
const strip = section ? section.querySelector('.home-products-strip') : null;
|
||||
|
||||
if (!strip) {
|
||||
return;
|
||||
}
|
||||
|
||||
const direction = button.hasAttribute('data-home-strip-prev') ? -1 : 1;
|
||||
strip.scrollBy({
|
||||
left: direction * Math.max(260, strip.clientWidth * 0.86),
|
||||
behavior: 'smooth',
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php if (false): ?>
|
||||
<div class="content-grid">
|
||||
<section class="panel">
|
||||
<h2>Каталог</h2>
|
||||
@@ -300,4 +399,5 @@ $arrivalDate = $lastArrival->format('j') . ' ' . $months[(int) $lastArrival->for
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
|
||||
@@ -33,6 +33,17 @@ if (!function_exists('category_tree_has_current')) {
|
||||
}
|
||||
?>
|
||||
<ul class="category-list depth-<?= e((string) $depth) ?>">
|
||||
<?php if ($depth === 0): ?>
|
||||
<li class="category-special-link is-all">
|
||||
<a href="/catalog"><span>Весь каталог</span></a>
|
||||
</li>
|
||||
<li class="category-special-link">
|
||||
<a href="/#home-promos"><span>Акции</span></a>
|
||||
</li>
|
||||
<li class="category-special-link">
|
||||
<a href="/#home-new"><span>Новинки</span></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php foreach ($items as $category): ?>
|
||||
<?php $isCurrent = ($currentSlug ?? '') === $category['slug']; ?>
|
||||
<?php $hasChildren = !empty($category['children']); ?>
|
||||
|
||||
@@ -31,8 +31,18 @@ if (!function_exists('render_mega_category_children')) {
|
||||
<?php if ($megaCategories !== []): ?>
|
||||
<nav class="category-mega-bar" aria-label="Категории товаров">
|
||||
<div class="category-mega-inner">
|
||||
<a class="mega-root mega-all-link" href="/catalog">Весь каталог</a>
|
||||
<a class="mega-root mega-virtual-link is-promo" href="/#home-promos">Акции</a>
|
||||
<a class="mega-root mega-virtual-link is-new" href="/#home-new">Новинки</a>
|
||||
<?php foreach ($megaCategories as $category): ?>
|
||||
<?php if (($category['slug'] ?? '') === 'myasnaya-gastronomiya' || ($category['name'] ?? '') === 'Мясная гастрономия') {
|
||||
<?php
|
||||
$hiddenTopCategorySlugs = ['myasnaya-gastronomiya', 'molochnaya-produkciya'];
|
||||
$hiddenTopCategoryNames = ['Мясная гастрономия', 'Молочная продукция'];
|
||||
|
||||
if (
|
||||
in_array((string) ($category['slug'] ?? ''), $hiddenTopCategorySlugs, true)
|
||||
|| in_array((string) ($category['name'] ?? ''), $hiddenTopCategoryNames, true)
|
||||
) {
|
||||
continue;
|
||||
} ?>
|
||||
<?php $iconName = category_tree_icon((string) $category['name']); ?>
|
||||
|
||||
@@ -73,6 +73,9 @@ $isPurchasable = $isPublished && $isAvailable && $activePackagePrice > 0;
|
||||
<?php if (!$isPurchasable): ?>
|
||||
<span class="product-unavailable-badge"><?= !$isPublished ? 'Ожидается поступление' : 'Нет в наличии' ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($product['badge_label']) && $isPurchasable): ?>
|
||||
<span class="product-card-badge is-<?= e((string) ($product['badge_kind'] ?? 'default')) ?>"><?= e((string) $product['badge_label']) ?></span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($product['main_image_path']) && $isPurchasable): ?>
|
||||
<a class="product-card-image" href="/product/<?= e($product['slug']) ?>" aria-label="<?= e($product['name']) ?>">
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<section class="wishlist-request-panel" id="wishlist-request">
|
||||
<div class="wishlist-request-copy">
|
||||
<p class="eyebrow">Запрос позиции</p>
|
||||
<h2>Одна голова хорошо, две лучше</h2>
|
||||
<p>Нужна позиция, но нигде не можете ее найти? Отправьте нам наименование и объем. Наши менеджеры постараются помочь Вам в поиске.</p>
|
||||
<span>Для частных покупателей и бизнеса</span>
|
||||
</div>
|
||||
|
||||
<div class="wishlist-request-card">
|
||||
<?php if (($_GET['wishlist_request'] ?? '') === 'sent'): ?>
|
||||
<div class="status-box success">Ваш запрос принят. Если найдем подходящий вариант, обязательно свяжемся с вами.</div>
|
||||
<?php elseif (($_GET['wishlist_request'] ?? '') === 'error'): ?>
|
||||
<div class="status-box danger">Не удалось отправить запрос. Укажите имя, что нужно найти, и телефон или email.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form class="wishlist-request-form" action="/wishlist-request" method="post" enctype="multipart/form-data">
|
||||
<label>
|
||||
<span>Имя</span>
|
||||
<input type="text" name="customer_name" placeholder="Как к Вам обращаться" required>
|
||||
</label>
|
||||
<label>
|
||||
<span>Телефон</span>
|
||||
<input type="tel" name="phone" placeholder="+7 ___ ___-__-__">
|
||||
</label>
|
||||
<label>
|
||||
<span>Email</span>
|
||||
<input type="email" name="email" placeholder="mail@example.ru">
|
||||
</label>
|
||||
<label class="wide">
|
||||
<span>Что нужно найти</span>
|
||||
<textarea name="request_text" rows="5" placeholder="Например: филе судака 10 кг, икра в стеклянной банке, креветки под нужный размер" required></textarea>
|
||||
</label>
|
||||
<label class="file-field wide">
|
||||
<span>Прикрепить файлы</span>
|
||||
<input type="file" name="wishlist_files[]" multiple>
|
||||
<small>Можно приложить фото, список или пример товара.</small>
|
||||
</label>
|
||||
<p class="form-hint wide">Телефон или email - достаточно одного контакта. Если сможем помочь с поиском, менеджер свяжется с Вами.</p>
|
||||
<button class="primary-button wide" type="submit">Отправить запрос</button>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user