PrestashopA recent client asked for some modification to an online shop built on Prestashop. Now, Prestashop is built using Smarty 3 templating system. A rather weird system, with scattered bits and pieces of .tpl files, modules and CSS.

I won’t go into any more details, I’ll just show you how to add a list of “More/Other products in the same category” products with price and link to product page.

{if count($categoryProducts) > 0}<br />
<h2>{$categoryProducts|@count} {l s='other products in the same category:' mod='productscategory'}</h2>

{foreach from=$categoryProducts item='categoryProduct' name=categoryProduct}
<a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" title="{$|htmlspecialchars}">
{if $ProdDisplayPrice AND $categoryProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}
<span>({convertPrice price=$categoryProduct.displayed_price})</span>
<br />

If you want to limit the number of characters for each product, use this line instead of the one above:


submit to reddit

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

behance roo wordpress