Jump to content
thirty bees forum

Display FAQ hook in different places when using multistore

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}


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'}
	  {* Default content if no domain match *}
	  {hook h='displayFAQs' entityType='product' entityId=$product->id}


Edited by the.rampage.rado
Link to comment
Share on other sites

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