explodedk Posted May 12, 2014 Share Posted May 12, 2014 (edited) hi there. i am trying to make a few adjustments on a custom html module. i want the link to open in an iframe like the terms and conditions on the checkout page. i've tried the following code, but it's just opening the cms page with content only, and not in a frame like this : <a class="iframe" href="http://billigedufte.dk/mob/manufacturers?content_only=1" rel="nofollow"><em class="icon-check"> </em>Alle de kendte mærker </a> you can see the code here on www.billigedufte.dk/mob it's the line just above the diasshow saying: Alle de kendte mærker 100% ægte parfume Fri fragt ved køb over 1000kr Gode priser og sikker betaling Edited May 13, 2014 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 do you included to your page, where you wan tto display this link in popup libraries: -fancybox -script to open hrefs with class="iframe" in fancybox ? Link to comment Share on other sites More sharing options...
explodedk Posted May 12, 2014 Author Share Posted May 12, 2014 hmm nope. that's the problem for sure. cause the links are working in the checkout page. what and where should i add it to work on every page with the iframe class? Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 to your front controller add code: $this->addJqueryPlugin(array('fancybox')); to run fancybox for iframes use code like: <script type="text/javascript"> $(document).ready(function() { $(".iframe").fancybox(); }); </script> Link to comment Share on other sites More sharing options...
explodedk Posted May 12, 2014 Author Share Posted May 12, 2014 (edited) i am still not totally sure what i need to do:) i guess i should add the first code to my /controllers/front/indexcontroller.php but where to add the second lines of code? fyi: i moved the www to www.billigedufte.dk Edited May 12, 2014 by explodedk (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 what is your prestashop version? Link to comment Share on other sites More sharing options...
explodedk Posted May 12, 2014 Author Share Posted May 12, 2014 1.6.0.6 Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 classes/controllers/FrontController.php add code to include plugin in setMedia() function script that i suggested to use in header.tpl for example don't forget about {literal}{/literal} tags Link to comment Share on other sites More sharing options...
explodedk Posted May 12, 2014 Author Share Posted May 12, 2014 hmm i can't get it to work... i've attached my two files: /public_html/billigedufte.dk/themes/leomobi/header.tpl https://pastee.org/wndp and /public_html/billigedufte.dk/classes/controller/FrontController.php https://pastee.org/zv864 im pretty sure i am doing wrong here Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 you recompiled template after changes in .tpl file ? Link to comment Share on other sites More sharing options...
explodedk Posted May 12, 2014 Author Share Posted May 12, 2014 i am using smarty template compilation with Force compilation. should be enough right ? Link to comment Share on other sites More sharing options...
vekia Posted May 12, 2014 Share Posted May 12, 2014 yes it's enough. so, when you click on link with class="iframe" <a class="iframe" href="website"></a> what's going on? Link to comment Share on other sites More sharing options...
explodedk Posted May 13, 2014 Author Share Posted May 13, 2014 when i click on a link with class="iframe" it opens the desired page normally in _self no fancybox - however, if i click the link on the check-out page, it is working flawless. Link to comment Share on other sites More sharing options...
vekia Posted May 13, 2014 Share Posted May 13, 2014 try to move {literal} <script type="text/javascript"> $(document).ready(function() { $(".iframe").fancybox(); }); </script> {/literal} to the <head></head> section i tried the same code on my own and it works well Link to comment Share on other sites More sharing options...
vekia Posted May 13, 2014 Share Posted May 13, 2014 i created link like: <a href="http://localhost/1606a/modules/themeconfigurator/img/banner-img6.jpg" class="iframe">TEST</a> (change href="" to any other you want) Link to comment Share on other sites More sharing options...
explodedk Posted May 13, 2014 Author Share Posted May 13, 2014 i don't get it . if i copy your line it works like it should - but di u change the url it's not working.. changed from <a href="http://localhost/1606a/modules/themeconfigurator/img/banner-img6.jpg" class="iframe">TEST</a> to <a href="manufacturers" class="iframe">TEST</a> but then it's not working... Link to comment Share on other sites More sharing options...
explodedk Posted May 13, 2014 Author Share Posted May 13, 2014 aight . so i got it to work ... wuhuuu... what i did was adding this code to my header.tpl {literal} <script type="text/javascript"> $('a.iframe').fancybox({ 'type' : 'iframe', 'width':600, 'height':600 }); </script> {/literal} 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