Jump to content

On Sale Tag not showing on Featured Products


Recommended Posts

Can anyone help with this.  I have several items which I have tagged as on sale in the product detail.  It shows the on sale tag on the actual product page but on the home page featured products it does not.

 

Version is 1.5.2 prestashop.

 

Also in the specials module it is only showing one product and not all the products that are on sale.  I have set the module to show 20 but it just shows one and does not rotate the others.

 

Any help much appreciated.

 

The website is www.shoedeck.co.uk

 

Many thanks.

Link to comment
Share on other sites

  • 11 months later...

This is not a feature of 1.5 but was added to 1.6, however I wrote a tutorial on how to accomplish this in 1.5 so here it is.

Let me know how it goes as it has been quite awhile since I used this code.

 

 

 

 

--------Banner for On Sale to Featured products 1.5-------------------
 
This will place a banner like the New banner in the image at the bottom left corner that reads On Sale when ever you check the
add on sale icon to a product.
 
First in homefeatured.tpl make a space after the code  <a href="{$product.link|escape:'ht ----- img-src lines in   (around line 41 )
and paste in these lines
 
{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale_featured">{l s='On Sale'}</span>
{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced Price'}</span>{/if}
 
 
 
Should look like this:
 
<a href="{$product.link|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" />{if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='homefeatured'}</span>{/if}
 
{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale_featured">{l s='On Sale'}</span>
{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced Price'}</span>{/if}
</a>
 
 
 
 
Then add this to homefeatured.css:   (anywhere)
 
#featured-products_block_center .product_image span.on_sale_featured {
display: block;
position: absolute;
top: 90px;
right:50px;
padding: 1px 4px;
width: 101px;
font-size:14px;
color:red;
text-align: center;
text-transform: uppercase;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform:rotate(45deg);
background-color: yellow;
transform: rotate(45deg); 
-ms-transform: rotate(45deg);
font-family:veranda;
}
 
 
Then add a height and width to homefeatuered.css    (existing block)
 
 
#featured-products_block_center .product_image 
 
width:131px;
height:131px
 
 
Link to comment
Share on other sites

  • 2 weeks later...

Thanks tdr170.

However I have not used the code, trying my best to minimize code edits.

 

However, I realize the sale icon shows correctly on login - the shop is set to not show prices without login.

However in multistore, there is a problem that the on sale status does not stick and resets with every edit made to the product. I have raised a bug.

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