Jump to content

Help Block New Products


dinaramalho

Recommended Posts

but it looks like modified code, i don't know what you changed there.

this module doesn't display product description by default.

if you want to use it for each product, you have to modify .tpl file add there {$product.description_short variable}

Link to comment
Share on other sites

I am using version 1.5.4.1 and made ​​no change in the file. tpl

 

Here is the file:

 

<

<!-- MODULE Block new products -->
<div id="new-products_block_right" class="block products_block">
<h4 class="title_block"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4>
<div class="block_content">
{if $new_products !== false}
<ul class="product_images clearfix">
{foreach from=$new_products item='product' name='newProducts'}
{if $smarty.foreach.newProducts.index < 2}
<li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li>
{/if}
{/foreach}
</ul>
 
<dl class="products">
{foreach from=$new_products item=newproduct name=myLoop}
<dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a></dt>
{if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}">{$newproduct.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></dd>{/if}
{/foreach}
</dl>
 
<p><a href="{$link->getPageLink('new-products')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">» {l s='All new products' mod='blocknewproducts'}</a></p>
{else}
<p>» {l s='Do not allow new products at this time.' mod='blocknewproducts'}</p>
{/if}
</div>
</div>
<!-- /MODULE Block new products -->
 

>

Link to comment
Share on other sites

if you want to display short description use {$product.description_short variable} variable in

{foreach from=$new_products item='product' name='newProducts'}
{if $smarty.foreach.newProducts.index < 2}
<li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li>
{/if}
{/foreach}

there, where you want to display it, for example 

<li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a>{$product.description_short variable}</li>
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...