Files

286 lines
9.9 KiB
Smarty
Raw Permalink Normal View History

2026-02-15 18:29:53 +03:00
{* Список товаров *}
<!-- Хлебные крошки /-->
<ul class="breadcrumb">
<li><a href="/">Главная</a></li>
{if $category}
{foreach from=$category->path item=cat}
<li><a href="/catalog/{$cat->url}/">{$cat->name|escape}</a></li>
{/foreach}
{if $brand}
<li><a href="/catalog/{$cat->url}/{$brand->url}/">{$brand->name|escape}</a></li>
{/if}
{elseif $brand}
<li><a href="/brands/{$brand->url}/">{$brand->name|escape}</a></li>
{elseif $keyword}
<li>Поиск</li>
{/if}
</ul>
<!-- Хлебные крошки #End /-->
{* Заголовок страницы *}
{if $keyword}
<h1>Поиск {$keyword|escape}</h1>
{if !$products}
Наш поиск по сайту не смог найти то, что Вы ищете.<br />
Но, возможно, этот товар есть в наличии. Позвоните нам по телефонам, указанным в контактах или закажите обратный звонок на сайте, чтобы наш менеджер смог Вас проконсультировать.
{/if}
{elseif $page && $page->name}
<h1>{$page->name|escape}</h1>
{else}
{if $brand && !$category}{$td = 'Товары для тюнинга '}{else}{$td=''}{/if}
{if $category->parent_id == 488 && $brand}
<h1>{$category->category_h1|escape} {$keyword|escape}</h1>
{else}
<h1>
{if $category->category_h1}
{$category->category_h1|escape} {$td}{$brand->name|escape} {$keyword|escape}{if $smarty.get.page > 1} - страница {$smarty.get.page}{/if}
{else}Все товары{if $brand} для автомобилей {$brand->name}{/if}{if $smarty.get.page > 1} - страница {$smarty.get.page}{/if}
{/if}
</h1>
{/if}
{/if}
{* Описание страницы (если задана) *}
{$page->body}
{if $current_page_num==1}
{* Описание категории *}
{$category->description}
{/if}
{* Фильтр по брендам *}
{*include file='brands.tpl'*}
{* Описание бренда *}
{$brand->description}
{* Фильтр по свойствам *}
{if $features}
<table id="features">
{foreach $features as $f}
<tr>
<td class="feature_name" data-feature="{$f->id}">
{$f->name}:
</td>
<td class="feature_values">
<a href="{url params=[$f->id=>null, page=>null]}/" {if !$smarty.get.$f@key}class="selected"{/if}>Все</a>
{foreach $f->options as $o}
<a href="{url params=[$f->id=>$o->value, page=>null]}/" {if $smarty.get.$f@key == $o->value}class="selected"{/if}>{$o->value|escape}</a>
{/foreach}
</td>
</tr>
{/foreach}
</table>
{/if}
<!--Каталог товаров
{if $products || 1}
{* Сортировка *}
{if $products|count>0}
<div class="sort" align="right">
Сортировать по
<a {if $sort=='position'} class="selected"{/if} href="{url sort=position page=null}">умолчанию</a>
<a {if $sort=='price'} class="selected"{/if} href="{url sort=price page=null}">цене</a>
<a {if $sort=='name'} class="selected"{/if} href="{url sort=name page=null}">названию</a>
</div>
{/if}
Каталог товаров-->
{if $category->subcategories && $category->id != 246 && $category->id != 24 && $category->id != 15} {*if1*}
{* подразделы *}
{* Костыль для разделов, которые как бренды *}
{if in_array($category->id, array(257, 15, 50, 32, 33, 43, 415))}
{include file='category_like_brands.tpl'}
{else}
{include file='category.tpl'}
{/if}
{else} {* /if1*}
{if $category->id == 15} {*if2*}
{include file='category_like_brands.tpl'}
<div class="h3">Все товары</div>
{/if} {* /if2*}
{if $category->id == 246 || $category->id == 24}{include file='category.tpl'}<div class="h3">Все товары</div>{/if}
{*if $category->id == 15}<div class="h3">Все товары</div>{/if*}
<div style="text-align: right;">{include file='pagination_new.tpl'}</div>
<!-- Список товаров-->
{literal} <script>$.yEcommerce = [];</script> {/literal}
<div class="products clearfix">
{foreach $products as $product}
<!-- Товар-->
<div class="product cleafix" itemscope itemtype="http://schema.org/Product">
<!-- Фото товара -->
{if $product->image}
<div class="product-image col-sm-3">
<a href="/products/{$product->url}/" class="w"><img itemprop="image" src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}" class="img-thumbnail"/></a>
</div>
{/if}
<!-- Фото товара (The End) -->
<div class="product-info col-sm-9">
<!-- Название товара -->
<span class="{if $product->featured}featured{/if}" itemprop="name"><a class="product-name" data-product="{$product->id}" href="/products/{$product->url}/" itemprop="url">{$product->name|escape}</a></span>
<!-- Название товара (The End) -->
<!-- Описание товара -->
<div class="product-annotation" itemprop="description">{$product->annotation}</div>
<!-- Описание товара (The End) -->
{if $product->variants|count > 0}
<!-- Выбор варианта товара-->
<!-- Выбор варианта -->
{assign var="pmin" value=99999999}
{assign var="priceFlag" value=0}
{foreach $product->variants as $v}
{if $v@first || $v->price<$pmin}
{assign var="pmin" value=$v->price}
{assign var="vmin" value=$v->id}
{assign var="nmin" value=$v->name}
{assign var="smin" value=$v->stock}
{/if}
{if $v->price != $pmin && $pmin != 99999999}
{assign var="priceFlag" value=1}
{/if}
{/foreach}
{literal}
<script>
var x = {/literal}{$product|@json_encode nofilter}{literal}
x._price = {/literal}{$pmin}{literal}
$.yEcommerce.push( x );
</script>
{/literal}
<form class="variants" action="/cart">
<input style="display:none" name="variant" value="{$vmin}" type="radio" checked />
<div class="text-right col-sm-9" style="padding-right: 0px;">
<span class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span class="mdh" itemprop="priceCurrency" data-content="RUB">RUB</span><span class="mdh" itemprop="price" data-content="{$pmin}">{$pmin}</span>
{if $priceFlag == 1}<small>цена от</small>{else}<small>цена</small>{/if}
{$pmin|convert} <small>{$currency->sign|escape}</small></span>
{if $v->compare_price > 0} <span class="product-compare-price">
{if $priceFlag == 1}<small>цена от</small>{else}<small>цена</small>{/if}
{$v->compare_price|convert} <small>{$currency->sign|escape}</small></span>{/if}
</div>
<div class="text-right col-sm-3" style="padding-right: 0px;">
{if $smin !='0'}
<a data-product="{$product->id}" href="/products/{$product->url}/" class="btn btn-danger">Купить
{*<input type="button" class="btn btn-danger" value="Купить" data-result-text="добавлено"/>*}
</a>
{else}
<input type="button" class="btn btn-danger preorder" data-id="{$product->variant->id}" value="Предзаказ"/>
{/if}
</div>
</form>
<!-- End Выбор варианта -->
<!-- Выбор варианта товара (The End) -->
{else}
Нет в наличии
{/if}
<div class="none" style="display: none;">
<div class="modal2 dialog amount well" id="amount{$product->variant->id}">
<form class="ajaxform preorder form-horizontal" action="ajax/preorder.php" method="post">
<input name="variant" value="{$product->variant->id}" type="hidden" />
<input name="comment" value="Предзаказ на {$product->name|escape:'html'}" type="hidden" />
<span class="header h22">Предзаказ</span>
<p><a href="/products/{$product->url}/">{$product->name|escape}</a></p>
<p>Как только товар будет в наличии, наш менеджер свяжется с Вами.</p>
<div class="line form">
<div class="form-group">
<label class=" col-sm-3 control-label">Имя</label>
<span class=" col-sm-9"><input name="name" class="form-control" type="text" value="{$name|escape}" /></span>
</div>
<div class="form-group">
<label class=" col-sm-3 control-label">Фамилия</label>
<span class=" col-sm-9"><input name="name2" class="form-control" type="text" value="{$name2|escape}" /></span>
</div>
<div class="form-group">
<label class=" col-sm-3 control-label">Email</label>
<span class=" col-sm-9"><input name="email" class="form-control" type="text" value="{$email|escape}" /></span>
</div>
<div class="form-group">
<label class=" col-sm-3 control-label">Телефон*</label>
<span class=" col-sm-9"><input name="phone" class="form-control" type="text" required="required" value="{$phone|escape}" /></span>
</div>
</div>
<p class="clear"></p>
<p class="pull-right"><input class="button btn btn-danger" type="submit" value="Отправить" /></p>
</form>
</div>
</div>
</div>
</div>
<!-- Товар (The End)-->
{/foreach}
</div>
{assign var="bottomPag" value=1}
<div style="text-align:right">{include file='pagination_new.tpl'}</div>
{/if}
<!-- Список товаров (The End)-->
{else}
{if $category->subcategories}
<a href="/catalog/{$c->url}/">{$c->name}</a>
{/if}
{/if}
{if $category->text_bottom}
{$category->text_bottom}
{/if}
<!--Каталог товаров (The End)-->
{literal}
<script>
//// yandex Ecommerce
var cat = [];
$('.breadcrumb li a').each(function(k, v){ if(k) cat.push($(v).text()); });
cat = cat.join('/');
window.dataLayer = window.dataLayer || [];
var products = [];
$.each($.yEcommerce, function(k, item){
products.push({
"id": item.id,
"name" : item.name,
"price": item._price,
"brand": item.brand,
"category": cat,
//"variant" : variant
});
});
dataLayer.push({
"ecommerce": {
"detail": {
"products": products
}
}
});
</script>
{/literal}