Sathees Posted October 28, 2016 Share Posted October 28, 2016 Hello, I am making a website for a takeaway that offer delivery service as well. I thought to make a little pop up when the shop is closed (I made also an event on the database to open the site in catalog mode and another to take it out of catalog mode, in coincidence with the shop timing, and changed also the files to show the price even if the site is in catalog mode.) This script is included just before the </head> inside header.tpl, inside the theme that I am using. The pop up code is included here, and can be used by anyone who has my same needs, as it took me around one week to come up with this as I am new. CSS file is also needed, please ask if you are interested, thanks. Now after searching for another one week I just decided to give up and try to ask for help. How can I include in this script a check that if catalog mode is set to 1 it will execute this pop up, otherwise no pop up is shown? Basically: If catalogmode == 1 then execute script else ignore pop up script. Any suggestion will be much appreciated, thanks. <script> jQuery(document).ready(function($){ if (sessionStorage.getItem('advertOnce') !== 'true') { $('body').append('<div id="advert-once">Sorry, The shop is closed at the moment. <br> However, you can browse our menu if you would like to.<br><br><center><button class="shopclosedOK">OK</button></center></div>') sessionStorage.setItem('advertOnce','true'); } $('#advert-once .shopclosedOK').on('click',function(){ $('#advert-once').hide(); }); </script> Link to comment Share on other sites More sharing options...
Sathees Posted October 29, 2016 Author Share Posted October 29, 2016 Can anyone please give me a hand? Thanks. Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2016 Share Posted October 29, 2016 Try: {if $PS_CATALOG_MODE} Your script code {/if} Link to comment Share on other sites More sharing options...
Sathees Posted October 29, 2016 Author Share Posted October 29, 2016 It works perfectly, thank you very much @rocky 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