Jump to content

[SOLVED] Displaying SALE icon in Homefeatured column


Recommended Posts

Hi,

does anyone know how to display (probably should be overlay or?) SALE icon inside product block in Homefeatured column?
Of course sale img. would appear only when product is discounted.

Something like that could be seen (at the moment) at:
http://www.gear-zone.co.uk/summer-tents-cid83.html
http://www.kraxel.com/zelte

http://www.e.kreasite.fr/Shopping/ - new products


Thanks in advance!

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
Add code like the following:

{if $product.on_sale}<img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>{/if}




Hi rocky, where to put this code? I put in homefutured.tpl but it's not work
and how to put on sale icon in price drop list ( now it is only inscription on sale) and in category list
thank's
Link to comment
Share on other sites

  • 2 weeks later...
Hi,

does anyone know how to display (probably should be overlay or?) SALE icon inside product block in Homefeatured column?
Of course sale img. would appear only when product is discounted.

Something like that could be seen (at the moment) at:
http://www.gear-zone.co.uk/summer-tents-cid83.html
http://www.kraxel.com/zelte

http://www.e.kreasite.fr/Shopping/ - new products


Thanks in advance!

Did you get this done successfully? I can place the icon but I have no idea how to overlay it on the product picture?
Link to comment
Share on other sites

  • 1 year later...

hello....

 

i try this code, but it´s does´t work for me.

 

where do i put this code:

{if $product.on_sale}<img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>{/if}

 

in to this:

<!-- MODULE Home Featured Products -->
<div id="featured_products">
   <h4>{l s='Featured products' mod='homefeatured'}</h4>
   {if isset($products) AND $products}
   <div class="block_content">
       <ul>
           {foreach from=$products item=product name=homeFeaturedProducts}
           <li class="ajax_block_product">
               <a class="product_image" href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.name|escape:html:'UTF-8'}" /></a>
               <div>
                   <h5><a class="product_link" href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:45:'...'|escape:'htmlall':'UTF-8'}</a></h5>
                   <div class="wrapper bottom">
                       <span class="price">{if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}{/if}</span>
                       <a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>
                   </div>
               </div>
           </li>
           {/foreach}
       </ul>
   </div>
   {else}
   <p>{l s='No featured products' mod='homefeatured'}</p>
   {/if}
</div>
<!-- /MODULE Home Featured Products -->

 

Please help me..

Link to comment
Share on other sites

Try it like this, this will keep the block with the sale icon from being larger then blocks that are not on sale.

This code is about placement, as you see in the code above I have placed the On Sale Icon in the product desciption area.

Copy and paste this code if it does not work you do not have something correct in the BO, Did you click on the checkbox for display on sale icon in the product edit area. (just below price entry)

 

 

 

<!-- MODULE Home Featured Products -->
<div id="featured-products_block_center" class="block products_block">
<h4>{l s='Featured products' mod='homefeatured'}</h4>
{if isset($products) AND $products}
 <div class="block_content">
  {assign var='liHeight' value=342}
  {assign var='nbItemsPerLine' value=4}
  {assign var='nbLi' value=$products|@count}
  {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
  {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}
  <ul style="height:{$ulHeight}px;">
  {foreach from=$products item=product name=homeFeaturedProducts}
<li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}clear{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
 <h5><a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}</a></h5>
 <div class="product_desc"><a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}</a>
</br>
{if $product.on_sale}
 <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/>
{/if}
</div>
 <a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /></a>
 <div>
   {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}
  <a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>
  {if ($product.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product.available_for_order AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE}
	{if ($product.quantity > 0 OR $product.allow_oosp)}
	 <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
   {else}
   <span class="exclusive">{l s='Add to cart' mod='homefeatured'}</span>
   {/if}
  {else}
   <div style="height:23px;"></div>
  {/if}
 </div>
</li>
  {/foreach}
  </ul>
 </div>
{else}
 <p>{l s='No featured products' mod='homefeatured'}</p>
{/if}
</div>
<!-- /MODULE Home Featured Products -->

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...