Files
AtomicOld/design/default/html/main.tpl
2026-02-15 18:29:53 +03:00

185 lines
5.8 KiB
Smarty

{* Главная страница магазина *}
{* Для того чтобы обернуть центральный блок в шаблон, отличный от index.tpl *}
{* Укажите нужный шаблон строкой ниже. Это работает и для других модулей *}
{$wrapper = 'index.tpl' scope=parent}
{* Заголовок страницы *}
<h1>{$page->header}</h1>
{* Тело страницы *}
{$page->body}
{* Рекомендуемые товары *}
{get_featured_products var=featured_products}
{if $featured_products}
<!-- Список товаров-->
<h1>Рекомендуемые товары</h1>
<ul class="tiny_products">
{foreach $featured_products as $product}
<!-- Товар-->
<li class="product">
<!-- Фото товара -->
{if $product->image}
<div class="image">
<a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}"/></a>
</div>
{/if}
<!-- Фото товара (The End) -->
<!-- Название товара -->
<h3><a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a></h3>
<!-- Название товара (The End) -->
{if $product->variants|count > 0}
<!-- Выбор варианта товара -->
<form class="variants" action="/cart">
<table>
{foreach $product->variants as $v}
<tr class="variant">
<td>
<input id="featured_{$v->id}" name="variant" value="{$v->id}" type="radio" class="variant_radiobutton" {if $v@first}checked{/if} {if $product->variants|count<2}style="display:none;"{/if}/>
</td>
<td>
{if $v->name}<label class="variant_name" for="featured_{$v->id}">{$v->name}</label>{/if}
</td>
<td>
{if $v->compare_price > 0}<span class="compare_price">{$v->compare_price|convert}</span>{/if}
<span class="price">{$v->price|convert} <span class="currency">{$currency->sign|escape}</span></span>
</td>
</tr>
{/foreach}
</table>
<input type="submit" class="button" value="в корзину" data-result-text="добавлено"/>
</form>
<!-- Выбор варианта товара (The End) -->
{else}
Нет в наличии
{/if}
</li>
<!-- Товар (The End)-->
{/foreach}
</ul>
{/if}
{* Новинки *}
{get_new_products var=new_products limit=3}
{if $new_products}
<h1>Новинки</h1>
<!-- Список товаров-->
<ul class="tiny_products">
{foreach $new_products as $product}
<!-- Товар-->
<li class="product">
<!-- Фото товара -->
{if $product->image}
<div class="image">
<a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}"/></a>
</div>
{/if}
<!-- Фото товара (The End) -->
<!-- Название товара -->
<h3><a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a></h3>
<!-- Название товара (The End) -->
{if $product->variants|count > 0}
<!-- Выбор варианта товара -->
<form class="variants" action="/cart">
<table>
{foreach $product->variants as $v}
<tr class="variant">
<td>
<input id="new_{$v->id}" name="variant" value="{$v->id}" type="radio" class="variant_radiobutton" {if $v@first}checked{/if} {if $product->variants|count<2}style="display:none;"{/if}/>
</td>
<td>
{if $v->name}<label class="variant_name" for="new_{$v->id}">{$v->name}</label>{/if}
</td>
<td>
{if $v->compare_price > 0}<span class="compare_price">{$v->compare_price|convert}</span>{/if}
<span class="price">{$v->price|convert} <span class="currency">{$currency->sign|escape}</span></span>
</td>
</tr>
{/foreach}
</table>
<input type="submit" class="button" value="в корзину" data-result-text="добавлено"/>
</form>
<!-- Выбор варианта товара (The End) -->
{else}
Нет в наличии
{/if}
</li>
<!-- Товар (The End)-->
{/foreach}
</ul>
{/if}
{* Акционные товары *}
{get_discounted_products var=discounted_products limit=9}
{if $discounted_products}
<h1>Акционные товары</h1>
<!-- Список товаров-->
<ul class="tiny_products">
{foreach $discounted_products as $product}
<!-- Товар-->
<li class="product">
<!-- Фото товара -->
{if $product->image}
<div class="image">
<a href="products/{$product->url}"><img src="{$product->image->filename|resize:200:200}" alt="{$product->name|escape}"/></a>
</div>
{/if}
<!-- Фото товара (The End) -->
<!-- Название товара -->
<h3><a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a></h3>
<!-- Название товара (The End) -->
{if $product->variants|count > 0}
<!-- Выбор варианта товара -->
<form class="variants" action="/cart">
<table>
{foreach $product->variants as $v}
<tr class="variant">
<td>
<input id="discounted_{$v->id}" name="variant" value="{$v->id}" type="radio" class="variant_radiobutton" {if $v@first}checked{/if} {if $product->variants|count<2}style="display:none;"{/if}/>
</td>
<td>
{if $v->name}<label class="variant_name" for="discounted_{$v->id}">{$v->name}</label>{/if}
</td>
<td>
{if $v->compare_price > 0}<span class="compare_price">{$v->compare_price|convert}</span>{/if}
<span class="price">{$v->price|convert} <span class="currency">{$currency->sign|escape}</span></span>
</td>
</tr>
{/foreach}
</table>
<input type="submit" class="button" value="в корзину" data-result-text="добавлено"/>
</form>
<!-- Выбор варианта товара (The End) -->
{else}
Нет в наличии
{/if}
</li>
<!-- Товар (The End)-->
{/foreach}
</ul>
{/if}