Вопрос

How can I display the shop name in a module?

I know the global variable of smarty is $shop_name.
I tried with $Smarty.shop_name, but didn't work

Это было полезно?

Решение 4

If in PHP it is $shop_name

You need to in PHP run:

$Smarty->assign('shop_name', $shop_name);

And in Smarty template:

{$shop_name}

(I don't know Prestashop so maybe $Smarty should be lower-case)

Другие советы

I know it is old but it can be directly got in the tpl with:

{Configuration::get('PS_SHOP_NAME')}

It does the trick but it is better to send it using the smarty assign function

How about PS_SHOP_NAME? I believe it is loaded by the FrontController and available in every front office page.

Update 2022 (version 8)

As per version 8.00 this is working (and it should be used this way anyway) Use this variable in a .tpltemplate

{$shop.name}

That's it!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top