Jump to content

New Products Module Issue


Recommended Posts

I've had a play and you could try the following:

 

Change your blocknewproducts.tpl to:

 

<div id="new-products_block_right" class="block new_products_block">
<h4><a href="{$link->getPageLink('new-products.php')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4>
<div class="new_block_content">
{if $new_products !== false}
<ul class="product_images clearfix">
{foreach from=$new_products item='product' name='newProducts'}
{if $smarty.foreach.newProducts.index < 0}
{/if}
{/foreach}
</ul>
<dl class="products">
{foreach from=$new_products item=newproduct name=myLoop}
<h5 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></h5>
{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:50:'...'}</a></dd>{/if}
<a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($newproduct.link_rewrite, $newproduct.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" style="margin-left:3px" alt="{$product.legend|escape:html:'UTF-8'}" /></a>

{/foreach}
</dl>
<p><a href="{$link->getPageLink('new-products.php')}" 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>

and change your css to:

 

.new_products_block ul {padding-top:10px}
.new_products_block ul li {float: left; margin:1px 10px}

.new_products_block h5 a {font-weight:bold; float:right;margin-top:15px;width:147px}
.new_products_block dl dt a {font-weight:bold}

.new_products_block dl {clear:both;padding:2px 0 0 0;border-top:1px solid #ccc}
.new_products_block dl dt {margin:9px 0 0 0}
.new_products_block dl dd a {font-size: 11px;}
.new_products_block dl dd a img {}
.new_products_block dd {height:1em;margin-left:84px}
.new_products_block p a.button_large {width:211px;margin:12px 0 0 0;color:#fff}

Edited by jhnstcks
a few changes (see edit history)
Link to comment
Share on other sites

I've had a play and you could try the following:

 

Change your blocknewproducts.tpl to:

 

<div id="new-products_block_right" class="block new_products_block">
<h4><a href="{$link->getPageLink('new-products.php')}" title="{l s='New products' mod='blocknewproducts'}">{l s='New products' mod='blocknewproducts'}</a></h4>
<div class="new_block_content">
{if $new_products !== false}
<ul class="product_images clearfix">
{foreach from=$new_products item='product' name='newProducts'}
{if $smarty.foreach.newProducts.index < 0}
{/if}
{/foreach}
</ul>
<dl class="products">
{foreach from=$new_products item=newproduct name=myLoop}
<h5 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></h5>
{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:50:'...'}</a></dd>{/if}
<a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($newproduct.link_rewrite, $newproduct.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a>

{/foreach}
</dl>
<p><a href="{$link->getPageLink('new-products.php')}" 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>

and change your css to:

 

.new_products_block ul {padding-top:10px}
.new_products_block ul li {float: left; margin:1px 10px}

.new_products_block h5 a {font-weight:bold; float:right;margin-top:10px;width:150px}
.new_products_block dl dt a {font-weight:bold}
.new_products_block dl {clear:both;padding:2px 0 0 0;border-top:1px solid #ccc}
.new_products_block dl dt {margin:9px 0 0 0}
.new_products_block dl dd a {font-size: 11px;}
.new_products_block dl dd a img {}
.new_products_block dd {height:1em;margin-left:81px}
.new_products_block p a.button_large {width:211px;margin:12px 0 0 0;color:#fff}

 

Good god, you are a master with code my friend. Just when I thought id have to simply set the number at 1 and be happy that worked more than perfectly, thank you very much :D

 

Since its been kind of hard for me to get too many replies here I wonder though if youd be willing to help me on 1 last issue? As youve probably already noticed on my site I removed the Prestashop logo but theres still a huge gap from the menu to the top. This is because I was unable to remove the header code completely. Everytime I try and remove it, it renders the entire store blank.. Can you think what may be causing this?

Edited by kin6x (see edit history)
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...