Daniel Patilea Posted August 6, 2014 Share Posted August 6, 2014 (edited) I'm trying to display the variable date_add : <p>{$product.date_add}</p> on the bestsellers block but it does not displaying anything. Can anybody tell why? Here's the full code: <div id="leftmodules"> <!-- MODULE Block best sellers --> <div id="best-sellers"> <h4 class="top-sellers-h4"><a href="{$link->getPageLink('best-sales.php')}">{l s='Top 5 Sellers' mod='blockbestsellers'} <span>{l s='' mod='blockbestsellers'}</span></a></h4> {assign var='nbItemsPerLine' value=5} {if $best_sellers|@count > 0} <ul class="product_images owl-carousel" id="owl-best"> {foreach from=$best_sellers item=product name=bestSellers} <div> <li class="{if $smarty.foreach.bestSellers.first}first_item{elseif $smarty.foreach.bestSellers.last}last_item{else}item{/if} {if $smarty.foreach.bestSellers.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.bestSellers.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.bestSellers.iteration > ($smarty.foreach.bestSellers.total - ($smarty.foreach.bestSellers.total % $nbItemsPerLine))}last_line{/if}"> <a href="{$product.link}" title="{$product.name|escape:'htmlall':'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="250" width="200" alt="{$product.legend|escape:'htmlall':'UTF-8'}" /></a> <h4><a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:25:'...'|escape:'htmlall':'UTF-8'}</a></h4> <div class="product_desc">{$product.description_short|strip_tags|truncate:60:'.....'}<a href="{$product.link}" title="{l s='More' mod='homefeatured'}">Read More >></a></div> <p>{$product->date_add}</p> </li> </div> {/foreach} </ul> {else} <p>{l s='No best sellers at this time' mod='blockbestsellers'}</p> {/if} </div> <!-- /MODULE Block best sellers --> </div> Edited August 6, 2014 by iDan (see edit history) Link to comment Share on other sites More sharing options...
Daniel Patilea Posted August 8, 2014 Author Share Posted August 8, 2014 Found the sollution, hope this helps someone . I saw that this module uses a function called getBestSalesLight(). This function does not select all the informations about products from database so I had to add what I needed in the querry. Link to comment Share on other sites More sharing options...
Recommended Posts