Jump to content
thirty bees forum

Recommended Posts

Posted (edited)

I would like to display the FAQ snippets on another place because I added it to a section that is not visible in the design I use in the new shops I added later.

Could we use something like that because it's not showing and I don't know if the code is wrong or?

	{if isset($id_shop) && $id_shop == 3}
		{hook h='displayFAQs' entityType='product' entityId=$product->id}
	{else}
		<p></p>
	{/if}

EDIT:

I made it work with different approach, instead of shop ID I detect the domain and as I only have one shop where the design is different I reversed the if clause:
 

	{if $smarty.server.HTTP_HOST|strstr:'domain.com'}
	{else}
	  {* Default content if no domain match *}
	  {hook h='displayFAQs' entityType='product' entityId=$product->id}
	{/if}

 

Edited by the.rampage.rado
Posted

In smarty templates you can only use variables that were passed by controller. id_shop doesn't seems to be one of them

You can call static methods from templates, though.  You could add following line at the top of your template to declare this variable:

{$id_shop = Context::getContext()->shop->id}

And then use your original code (you don't need need isset() check anymore)

  • Like 1

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