Agafar correu de contacte a PrestaShop, nom de la tenda i posar valors a cookies

Si necessites agafar el correu de contacte o el nom de la tenda a PrestaShop:

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

Si a més necessites posar valors a cookies:

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

Per agafar el valor des de un template smarty (.tpl):

{$cookie->name_of_your_key}

Des de PHP (dins d’un controlador):

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

Fora d’un controlador:

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

Esper que això t’ajudi :)

19:00 hrs.Posted by in Uncategorized | 0 comments

Add Your Comment

Your email address will not be published.