Jump to content
thirty bees forum

How to check product visibility in product template


Recommended Posts

Posted

I want to check the product visibility in the product template (product.tpl). In product class there's the variable $visibility which stores a string:

/** @var string ENUM('both', 'catalog', 'search', 'none') front office visibility */
public $visibility;

And I've tried to access that variable directly fron product.tpl with no success. Is there a way to check if a class variable is passed to the controller? Or what do I need to do to have that variable available in the smarty template?

Thanks in advance.

Posted

Thanks, Michael. I'm checking the string value like this, but it's not rendering the p tag :S

{if $product->visiblity == 'both'}

visibility is both

{/if}

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