Rissinko Posted July 6, 2016 Share Posted July 6, 2016 Hi, Is there any solution how to detect in tpl file visitor which is on page for first time ? I want to create Welcome animation but show it only for first time visitors. Maybe something like detect if cookies were already created or somethink like that. Thanks. Link to comment Share on other sites More sharing options...
rocky Posted July 10, 2016 Share Posted July 10, 2016 You can do this by checking the $_COOKIE array, since it can't be modified until the page refreshes. For example, put the following line in the PHP file: $this->context->smarty->assign('first_time', count($_COOKIE) == 0); And then in your TPL file: {if $first_time}Welcome code goes here{/if} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now