Jump to content

Iframe Issue


macat

Recommended Posts

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/

Link to comment
Share on other sites

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

Which 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

  • 6 years later...

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.

 

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...