Guest Posted December 19, 2008 Share Posted December 19, 2008 Does anyone have a contrib, or know how to add a pop-up that will show for a settable amount of seconds when customers log-in? I'd like the ability to promote a product with a pop-up; but haven't been able to figure out how to add pop-ups that work. Thanks Doc Link to comment Share on other sites More sharing options...
germ Posted December 19, 2008 Share Posted December 19, 2008 Experiment with this. Put this code in your /catalog/index.php JUST BEFORE THE </body> TAG AT THE BOTTOM OF THE FILE: <?php if ( tep_session_is_registered('customer_id') ) { if ( ! tep_session_is_registered('Popped') ) { $Popped = 1; ?> <script type="text/javascript"> my_window = window.open("","mywindow","status=1,width=350,height=150"); my_window.document.write('<H1>Welcome!</H1>'); var t=setTimeout("my_window.close()",3000) </script> <?php tep_session_register('Popped'); } } ?> It opens a popup for 3 seconds only once after they login. To adjust the time until it closes, change the number 3000 in the code (hint: 1000 = 1 second). If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.