Jump to content

1.5.4.1 How to modify the look of new products block


Recommended Posts

in this case you have to modify the template (.tpl) file of the blocnewproducts module.

Open file: modules/blocknewproducts/blocknewproducts.tpl or if exist this one: themes/_YOUR_THEME_/blocknewproducts/blocknewproducts.tpl

 

you have to be familiar with smarty / html

 

if you don't know how to modify the files - feel free to write, i will try to help :)

Link to comment
Share on other sites

in this case you have to modify the template (.tpl) file of the blocnewproducts module.

Open file: modules/blocknewproducts/blocknewproducts.tpl or if exist this one: themes/_YOUR_THEME_/blocknewproducts/blocknewproducts.tpl

 

you have to be familiar with smarty / html

 

if you don't know how to modify the files - feel free to write, i will try to help :)

 

 

Yes please, here is my blocknewproducts.tpl

<!-- MODULE Block new products -->
<div id="new-products_block_right" class="block products_block">
<p class="title_block"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></p>
<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='No new products at this time' mod='blocknewproducts'}</p>
{/if}
</div>
</div>
<!-- /MODULE Block new products -->

 

here is my blockspecials.tpl

<!-- MODULE Block specials -->
<div id="special_block_right" class="block products_block exclusive blockspecials">
<p class="title_block"><a href="{$link->getPageLink('prices-drop')}" title="{l s='Specials' mod='blockspecials'}">{l s='Specials' mod='blockspecials'}</a></p>
<div class="block_content">
{if $special}
 <ul class="products clearfix">
  <li class="product_image">
   <a href="{$special.link}"><img src="{$link->getImageLink($special.link_rewrite, $special.id_image, 'medium_default')}" alt="{$special.legend|escape:html:'UTF-8'}" height="{$mediumSize.height}" width="{$mediumSize.width}" title="{$special.name|escape:html:'UTF-8'}" /></a>
  </li>
  <li>
   {if !$PS_CATALOG_MODE}
 {if $special.specific_prices}
  {assign var='specific_prices' value=$special.specific_prices}
  {if $specific_prices.reduction_type == 'percentage' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))}
   <span class="reduction"><span>-{$specific_prices.reduction*100|floatval}%</span></span>
  {/if}
 {/if}
   {/if}
 <p class="s_title_block"><a href="{$special.link}" title="{$special.name|escape:html:'UTF-8'}">{$special.name|escape:html:'UTF-8'}</a></p>
   {if !$PS_CATALOG_MODE}
 <span class="price-discount">{if !$priceDisplay}{displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}{/if}</span>
 <span class="price">{if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if}</span>
   {/if}
  </li>
 </ul>
 <p>
  <a href="{$link->getPageLink('prices-drop')}" title="{l s='All specials' mod='blockspecials'}">» {l s='All specials' mod='blockspecials'}</a>
 </p>
{else}
 <p>{l s='No specials at this time' mod='blockspecials'}</p>
{/if}
</div>
</div>
<!-- /MODULE Block specials -->

Edited by Mr.Curiosity (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...