prestashop_newuser Posted October 1, 2013 Share Posted October 1, 2013 Hi, In a module I want to show some message to the visitors and there will be a close button and when the users will click on the close button the message will be closed. But when I am again reloading the page the message is again showing. For that I have gone through many sites and forums and I have got one jQuery plugin called as jquery-cookie. But I don't know how to assign the value of cookie in my module. So can some one kindly tell me how to do this? Link to comment Share on other sites More sharing options...
vekia Posted October 1, 2013 Share Posted October 1, 2013 you can create cookie in many ways, with php - with setcookie() funcition and also with javascript document.cookie command which one to use? everything depends on how your script exactly works. Link to comment Share on other sites More sharing options...
prestashop_newuser Posted October 1, 2013 Author Share Posted October 1, 2013 you can create cookie in many ways, with php - with setcookie() funcition and also with javascript document.cookie command which one to use? everything depends on how your script exactly works. I want to use cookie in jQuery. But I think for that I have to assign cookie name. So can you tell me is there any way to get the cookie name from the module or any name which I will assign in cookie with the jQuery cookie plugin will work? Link to comment Share on other sites More sharing options...
vekia Posted October 1, 2013 Share Posted October 1, 2013 you can use this cookie with $_COOKIE['nameofcookie'] variable and yes, cookies asigned via js you can use in php Link to comment Share on other sites More sharing options...
prestashop_newuser Posted October 3, 2013 Author Share Posted October 3, 2013 you can use this cookie with $_COOKIE['nameofcookie'] variable and yes, cookies asigned via js you can use in php @Vekia thanks..that worked finally. Also this link made clear all the doubts Link to comment Share on other sites More sharing options...
vekia Posted October 3, 2013 Share Posted October 3, 2013 thank you for confirmation that it works for you glad to hear it ! you used someting like: if (!isset($_COOKIE['mycookiename'])){ HERE CODE FOR MESSAGE } am I right? Link to comment Share on other sites More sharing options...
prestashop_newuser Posted October 4, 2013 Author Share Posted October 4, 2013 thank you for confirmation that it works for you glad to hear it ! you used someting like: if (!isset($_COOKIE['mycookiename'])){ HERE CODE FOR MESSAGE } am I right? I just did $.cookie('nameofthecookie') in my js file and I have included jQuery Cookie plugin Link to comment Share on other sites More sharing options...
vekia Posted October 5, 2013 Share Posted October 5, 2013 thank you for solution! it will be helpful for other merchants and devs here, for example for me im going to mark this thread as [solved] with regards Milos Link to comment Share on other sites More sharing options...
Recommended Posts