feat: add new mainpage products options, hide attributes

This commit is contained in:
2025-08-07 18:07:18 +03:00
parent f2f1618e0e
commit d9fd26d354
3 changed files with 3 additions and 2 deletions

View File

@@ -381,6 +381,7 @@ HTML,
'type' => 'select',
'options' => [
'most_viewed' => 'Популярные товары',
'latest' => 'Последние сверху',
'featured' => 'Избранные товары (задать в поле ниже)',
],
'help' => 'Выберите, какие товары показывать на главной странице магазина в Telegram. Это влияет на первую видимую секцию каталога для пользователя.',

View File

@@ -108,7 +108,7 @@ class ProductsHandler
$products = $productsQuery
->forPage($page, $perPage)
->orderBy('viewed', 'DESC')
->orderBy($mainpageProducts === 'latest' ? 'date_modified' : 'viewed', 'DESC')
->get();
$productIds = Arr::pluck($products, 'product_id');

View File

@@ -33,7 +33,7 @@
</div>
</div>
<div class="mt-3">
<div v-if="product.attributes && product.attributes.length > 0" class="mt-3">
<h3 class="font-bold mb-2">Характеристики</h3>
<div class="space-y-6">