Lately I had to rewrite one of the xCart`s templates to show not one, but two products per row in the homepage at “Featured products” box.
It`s simple as it sounds 🙂
Open template products_list.tpl and on line 23 add this
style="width:45%; float:left;" |
style="width:45%; float:left;"
so it should look like this:
<div{interline name=products additional_class=item} style="width:45%; float:left;"> |
<div{interline name=products additional_class=item} style="width:45%; float:left;">
Ot line 122 add:
<div style="clear:both;"></div> |
<div style="clear:both;"></div>
it should look like this:
{/foreach}
<div style="clear:both;"></div>
</div> |
{/foreach}
<div style="clear:both;"></div>
</div>
And now you will have two products per row in your homepage 🙂
Отваряме product.php и на ред 106 (при не модифицирана система) поставяме следният код:
$product_info['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid=$product_info['manufacturerid']"); |
$product_info['manufacturer'] = func_query_first_cell("SELECT manufacturer FROM $sql_tbl[manufacturers] WHERE manufacturerid=$product_info['manufacturerid']");
След това намираме product.tpl в темплейта, който използваме за сайта и в него на мястото където искаме да покажем името на производителя пишем {$product.manufacturer}
Ако искате можете да добавите логото на производителя вместо името му като използвате пак в product.tpl следният код:
<img src="/image.php?id={$product.manufacturerid}&type=M" alt="{$manufacturer}" /> |
<img src="/image.php?id={$product.manufacturerid}&type=M" alt="{$manufacturer}" />