macat Posted May 6, 2015 Share Posted May 6, 2015 I am trying to use an iframe to embed the shop into an existing site, the iframe is working BUT a javascript code I have used in numerous sites to to have the iframe resize so there are no scroll bars has worked in every other site I have used it on but won't work here. Is there some coding in the cart to prevent iframe usage??The store is on the same domain so that is not the issue.Site is not live, still working on it:http://romanianrescueappeal.org/page/shop/ Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 6, 2015 Share Posted May 6, 2015 If you have iframes working, then I assume you found the statement in /index.php that sets the header:header('X-Frame-Options: SAME-ORIGIN'); // do not allow iframesWhich I suppose the comment is not correct. Maybe it should say, "do not allow outside domain iframe sources".Other than the above, there isn't any other code I know of to stop this from happening. Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 6, 2015 Share Posted May 6, 2015 In the code below the iframe, I see two javascript functions. Where is the code that calls these functions? Quote Link to comment Share on other sites More sharing options...
macat Posted May 7, 2015 Author Share Posted May 7, 2015 Whooohoooo ... Thank you bsmither, I actually hadn't noticed that in the header but after your reply and my removing it, it is working!!! It was driving me crazy for hours yesterday. Thank you again.If you have iframes working, then I assume you found the statement in /index.php that sets the header:header('X-Frame-Options: SAME-ORIGIN'); // do not allow iframes Quote Link to comment Share on other sites More sharing options...
macat Posted May 7, 2015 Author Share Posted May 7, 2015 OK, I did find one little issue, not sure if it can be fixed ... when you are looking at a product and click on the specifications tab, it is lengthened by java so the frame doesn't adjust and the customer reviews are getting cut off, do you know of any way to fix that? Quote Link to comment Share on other sites More sharing options...
bsmither Posted May 7, 2015 Share Posted May 7, 2015 Not knowing how the script actually works that finds the height of the contents in the frame, then adjusts the frame height to match, I wouldn't know where to start.But with Foundation being "responsive", it's height is going to change when, on mobile devices, sub-categories expand out from parent categories and other effects that change the height of the page without a reload being necessary -- the instance you describe being one of them.I would have to say that the "detector" that solves the question of how high is the document will need to be retriggered every time the dimensions of the framed document changes. I don't know the javascript that does that. Quote Link to comment Share on other sites More sharing options...
macat Posted May 7, 2015 Author Share Posted May 7, 2015 OK, I think it will be OK, I will just disable comments. Other than that it is working like a charm. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
macat Posted May 20, 2015 Author Share Posted May 20, 2015 Well it worked for a while then quit??? I have removed the coding to make the iframe adjust for now, if anyone has a working code to make an iframe height on the same domain adjust to page content, I would appreciate it if you could let me know. Quote Link to comment Share on other sites More sharing options...
M6VMO Posted March 13, 2022 Share Posted March 13, 2022 I was wondering if I could have the code for the iframe. I am desperately trying to make my shop open in the same window, but so far, even basic iframe code did not work for me, which it usually does: <iframe src="https://www.composer-componist.tk/shop/index.php?set_language=nl-NL&set_currency=EUR" width="100%" height="300" style="border:0"> </iframe> It even displayed a 404 error in place of the iframe. Any idea where I could have gone wrong? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 13, 2022 Share Posted March 13, 2022 Unfortunately, a 302 redirect may cause the loss of any POST payload (such as submitting a form). CubeCart will issue a 302 redirect to the browser when finishing the 'set_language' command. CubeCart, again, will issue a 302 redirect when finishing the 'set_language' command. As these commands are part of the <iframe> src attribute, I fear that nothing will ever work right (but I haven't tested this theory). Then there is the issue of redirects in an iframe. From my initial internet search, modern browsers may have become very strict on how that happens. I would think that the browser's Developer Tools, Network screen and Console screen would give some clues as to what may be broken. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.