Jump to content

How can I create an if else statement for multistores?


Recommended Posts

Yes you ca, But before that I need to know where (PHP version or tpl one).

 

You'll have to test the actal shop_id in the context (PHP case).

 

For the TPL one, read this really useful post (Pretty useful in Multi-shop) :

http://www.prestasho...arty-variables/

 

It let you test the ms_id in tpls (multishop ID)

 

Martin

Edited by Martin Uker K (see edit history)
Link to comment
Share on other sites

{if $ms_id == 4}
Your code
{else}
Other else
{/if}

This would be the way, As simple as that.

 

If you can't access ms_id, make sure your override is known by your prestasho: cache/class_index.php is up to date. If this file isn't just delete it and display one of your page (just rrefresh the home page) prestashop will re-scan an regenerate the file.

 

To make sure you can access this variable try

 

{$ms_id}

this should display a number ( Your shop id).

 

Good luck

 

Martin

Link to comment
Share on other sites

  • 1 year later...

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