Get the contact email in PrestaShop, shop name and set values in cookies

If you need to get the contact email or the name of a PrestaShop installation:

$shop_email = strval(Configuration::get('PS_SHOP_EMAIL'));
$shop_name = strval(Configuration::get('PS_SHOP_NAME'));

If you also need to put values into cookies:

$this->context->cookie->__set('name_of your_key', $your_value);

To get the value from a smarty template (.tpl):


From PHP (inside a controller):

$this->context->cookie->name_of your_key

Outside of a controller:

$context = Context::getContext();
$context->cookie->name_of your_key;

I hope this helps :)

07:00 PMPosted by in Uncategorized | 0 comments

Add Your Comment

Your email address will not be published.