07-27-2023, 12:18 AM
Prestashop
I am stuck we one problem for cookie. In prestashop 1.4.7 I create a custom cookie variable using setcookie but when i am try to access and assign it on front-controller, I am not getting cookies set value.
here is my script:
**page: checkpostcode.php**
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');
global $cookie;
setcookie("is_postcode_checked", 1, time()+600, "/", "", 1); // Set the cookie in basepath
**On frontcontroller.php page :**
I am access it using `$_COOKIE` and assign it into smarty array.
'is_postcode_checked' => $_COOKIE['is_postcode_checked'] // Getting null value for cookie
**page: checkpostcode.tpl**
{$cookie->_get(postcode_checked_msg)} // here get the is_postcode_checked value but
but I am not able to get `is_postcode_checked` variable value.
I am stuck we one problem for cookie. In prestashop 1.4.7 I create a custom cookie variable using setcookie but when i am try to access and assign it on front-controller, I am not getting cookies set value.
here is my script:
**page: checkpostcode.php**
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');
global $cookie;
setcookie("is_postcode_checked", 1, time()+600, "/", "", 1); // Set the cookie in basepath
**On frontcontroller.php page :**
I am access it using `$_COOKIE` and assign it into smarty array.
'is_postcode_checked' => $_COOKIE['is_postcode_checked'] // Getting null value for cookie
**page: checkpostcode.tpl**
{$cookie->_get(postcode_checked_msg)} // here get the is_postcode_checked value but
but I am not able to get `is_postcode_checked` variable value.