Jump to content

Make condition if product price don´t is checked (PHP)


seog

Recommended Posts

Hi,

 

I need display a image when in a product "Show price" don´t is checked.

(Catalog>Products> Editingproduct>Info>Options>Display Price)

 

The code in product.tpl for show price is: {if $product->show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}

 

How i can add image when the product price don´t is checked ?

 

example:

{if $product->show_price DON´T CHECKED}

<img src="../themes/img/call_us.gif" />

{/if}

 

 

Best regards

Link to comment
Share on other sites

OK, I think I found it...

There is some confusion possible in product.tpl because of not consequent use of insertions of tabs for all {if}-s etc, making it a hard to read file.

The code you found is INSIDE an earlier block where they check on show_price (starting at the 2nd 'show_price' you encounter in the file). Therefore you have to add your picture AFTER this earlier block to have some effect.

 

Find the black code as shown below.

 

You can then add the following RED code just ABOVE the black code:

 

 

{if !$product->show_price}

<img src="../themes/img/call_us.gif"alt="Call us"="">

{/if}

 

{if isset($HOOK_EXTRA_RIGHT) && $HOOK_EXTRA_RIGHT}{$HOOK_EXTRA_RIGHT}{/if}

</div>

</div>

 

 

{if (isset($quantity_discounts) && count($quantity_discounts) > 0)}

<!-- quantity discount -->

 

 

 

I think this is what you need.

Hope this helps,

Pascal

Edited by PascalVG (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...