Jump to content

How to hide "New" Label if product is on "Sale"


Btt

Recommended Posts

Hi there,

I need to hide the "New" Label if the product is on "Sale".

 

This is my tpl:

{if isset($product.new) && $product.new == 1}
					<span class="new-box">
						<span class="new-label label label-success">{l s='New'}</span>
					</span>
				{/if}
				{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}	
					<span class="sale-box">
						<span class="sale-label label label-danger">{l s='Sale'}</span>
					</span>

				{/if}

As you can see below i tried to edit this way but "New" Labels disappeared for all products even the one that aren't on Sale.

if isset($product.new) && $product.new == 1 && !isset($product.on_sale)}
					<span class="new-box">
						<span class="new-label label label-success">{l s='New'}</span>
					</span>
				{/if}
Link to comment
Share on other sites

Try:

 

{if isset($product.new) && $product.new == 1}

    {if !isset($product.on_sale) || isset($product.on_sale) && !$product.on_sale}

        <span class="new-box">
            <span class="new-label label label-success">{l s='New'}</span>
        </span>
    {/if}

{/if}

Link to comment
Share on other sites

  • 4 weeks later...

Try:

 

{if isset($product.new) && $product.new == 1}

    {if !isset($product.on_sale) || isset($product.on_sale) && !$product.on_sale}

        <span class="new-box">

            <span class="new-label label label-success">{l s='New'}</span>

        </span>

    {/if}

{/if}

Thanks for the reply yaniv14 it works! 

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