Answer the question
In order to leave comments, you need to log in
How to display a list of products in simpla cms?
People, tell me please, I ran into a problem ... You need to make the output of the goods in a table, that is, something like this:
there is a code:
<table id="purchases">
<tr>
{* Изображение товара *}
<td class="image">
{if $product->image}
<a href="products/{$product->url}"><img src="{$product->image->filename|resize:150:150}" alt="{$product->name|escape}"/></a>
{/if}
</td>
{* Название товара *}
<td class="name">
<a data-product="{$product->id}" href="products/{$product->url}">{$product->name|escape}</a>
</td>
{* Цена за единицу *}
<td class="price">
{$product->variant->price|convert} {$currency->sign|escape}
</td>
{* Количество *}
<td class="amount">
<form class="variants" action="/cart">
<table style="display: none;">
{foreach $product->variants as $v}
<tr class="variant">
<td>
<input name="variant" value="{$v->id}" type="radio" class="variant_radiobutton" {if [email protected]}checked{/if} {if $product->variants|count<2}style="display:none;"{/if}/>
</td>
<td>
{if $v->name}<label class="variant_name">{$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="button2" value="в корзину" data-result-text="добавлено"/>
</form>
</td>
</tr>
</table>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question