Jump to content

Smarty var shop.id is missing!


Recommended Posts

In multistore mode, different shops have same template, but slightly different settings like colors, logos, etc.

This is easily accomplished by adding shop-specific classes to the templates. Like when adding a shop id to the class-names in layout-both-columns.tpl. However only the shop-name, shop-addresses and other details that can all change regularly are available through the getTemplateVarShop() in the FrontController. Why is the $this->context->shop->id not in there, so it can easily be used in smarty as {$shop.id}

Also the smarty-var {$shop.name} is not the name of the shop, but the name of the shop-group! So all names of my shops in same group are same.

So, how do I get the shop-id in the layout-both-columns.tpl template?

Link to comment
Share on other sites

  • 4 months later...
  • 3 years later...
15 hours ago, nawres said:

same Problem ! can someone help me ?

Not exactly the solution i was looking for either, (since shop url could change) but i managed to get around the "missing shop_id" in smarty variables by using the shops "base_url": 

{if $urls.base_url == 'https://shop-front-url.de/'}
// notice the "/" at the end of the url
// show some content
{/if}

 

Link to comment
Share on other sites

1 hour ago, Tecc said:

Not exactly the solution i was looking for either, (since shop url could change) but i managed to get around the "missing shop_id" in smarty variables by using the shops "base_url": 

{if $urls.base_url == 'https://shop-front-url.de/'}
// notice the "/" at the end of the url
// show some content
{/if}

 

ok thanks ! it's woking now but we must change the url  after any changement 

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