
<div class="welcome">
    
    {$wd.metro_home_text|html_entity_decode}
</div>
{if $new_products !== false}
    {assign var='liHeight' value=250}
    {assign var='nbItemsPerLine' value=4}
    {assign var='nbLi' value=$new_products|@count}
    {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
    {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}
    <ul class="products-grid row">
        {foreach from=$new_products item=newproduct name=myLoop} 
            {math equation="(total%perLine)" total=$smarty.foreach.myLoop.total perLine=$nbItemsPerLine assign=totModulo}
        {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} 
        <li class="ajax_block_product {if $smarty.foreach.myLoop.first}first{elseif $smarty.foreach.myLoop.last}{else} {/if} {if $smarty.foreach.myLoop.iteration%$nbItemsPerLine == 0}{elseif $smarty.foreach.myLoop.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.myLoop.iteration > ($smarty.foreach.myLoop.total - $totModulo)} {/if} item {if ($i%3)==0}last{/if} span3">
            <div class="products-box">
                

            {if isset($newproduct.new) && $newproduct.new == 1} <div class="products-new">{l s='New' mod='wdnewproducts'}</div>{/if}
             {if isset($newproduct.on_sale) && $newproduct.on_sale && isset($newproduct.show_price) && $newproduct.show_price && !$PS_CATALOG_MODE} <div class="featured-product">&nbsp;</div>{/if}

            <a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}" class="product-image product_img_link"><img src="{$link->getImageLink($newproduct.link_rewrite, $newproduct.id_image, 'home_default')}"  alt="{$newproduct.name|escape:html:'UTF-8'}" /></a>

            <a href="{$link->getImageLink($newproduct.link_rewrite, $newproduct.id_image, 'thickbox_default')}" class="category_image" title="{$newproduct.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}" rel="tooltip">&nbsp;</a>
            <div class="shadow-s">&nbsp;</div>
            <h2 class="product-name"><a href="{$newproduct.link}" title="{$newproduct.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$newproduct.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h2>
            <div class="price-action"> 


                <div class="price-box">
                    <span class="regular-price" id="product-price-44">
        {if $newproduct.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <span class="price">{if !$priceDisplay}{convertPrice price=$newproduct.price}{else}{convertPrice price=$newproduct.price_tax_exc}{/if}</span>{else}<div style="height:21px;"></div>{/if}                                 
    </span>
</div>
    
   <div class="actions">
                         <a style="display:none !important;" href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}" class="product-image product_img_link"><img src="{$link->getImageLink($newproduct.link_rewrite, $newproduct.id_image, 'home_default')}"  alt="{$newproduct.name|escape:html:'UTF-8'}" /></a>
        {if ($newproduct.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $newproduct.available_for_order AND !isset($restricted_country_mode) AND $newproduct.minimal_quantity == 1 AND $newproduct.customizable != 2 AND !$PS_CATALOG_MODE}
            {if ($newproduct.quantity > 0 OR $newproduct.allow_oosp)}
            <a rel="ajax_id_product_{$newproduct.id_product|intval}" title="{l s='Add to cart' mod='wdnewproducts'}" class="ajax_add_to_cart_button button btn-cart" href="{$link->getPageLink('cart',false, NULL, "add&amp;id_product={$newproduct.id_product|intval}&amp;token={$static_token}", false)}"><span>{l s='Add to cart' mod='wdnewproducts'}</span></a>
        {else}
            <a rel="ajax_id_product_{$newproduct.id_product|intval}" title="{l s='Add to cart'}" class="ajax_add_to_cart_button button btn-cart" href="{$link->getPageLink('cart',false, NULL, "add&amp;id_product={$newproduct.id_product|intval}&amp;token={$static_token}", false)}"><span>{l s='Add to cart' mod='wdnewproducts'}</span></a>
        {/if}
    {else}
        <a  title="{l s='Out of Stock'}" class="ajax_add_to_cart_button button btn-cart" href="#"><span><span>{l s='Out of Stock'}</span></span></a>
    {/if}
                                 <ul class="add-to-links">
                                           <input type="hidden" name="qty" id="quantity_wanted" class="text"  value="1" size="2" maxlength="3" />
                  <li><a href="#" onclick="WishlistCart('wishlist_block_list', 'add', '{$newproduct.id_product|intval}', $('#idCombination').val(), document.getElementById('quantity_wanted').value); return false;"  rel="tooltip" class="link-wishlist" title="{l s='Add to Wishlist' mod='wdnewproducts'} ">&nbsp;</a></li>
                <li><span class="separator">|</span> 
                    <a href="#" rel="tooltip" title="{l s='Add to Compare' mod='wdnewproducts'}" class="new_comparator link-compare"  id="comparator_item_{$newproduct.id_product}">&nbsp;</a>
                </li>
                                        </ul>
            </div>
      <div class="clear"></div>  
</div>
</div>
</li>
{/foreach}
</ul>
{else}
    <p>{l s='No new products at this time' mod='wdnewproducts'}</p>
{/if}
</div>










<!-- /MODULE Block new products -->