Forums / General Questions / iframe not allowed in product description?

iframe not allowed in product description?

Views: 2,127

Results 1 to 10 of 10
3 Jul 2011, 6:04 PM
#1
shughey avatar

shughey

New Zenner

Join Date:
Feb 2009
Posts:
27
Plugin Contributions:
0

iframe not allowed in product description?

Using the latest version, I tried to enter an iframe in the product description field. When I previewed it I received an error message stating I am not authorized to perform that function. Can iframes not be used in zen cart? It's an external html page with nothing but a list of related products.

Thanks,
Sam

3 Jul 2011, 7:54 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: iframe not allowed in product description?

Zen Cart doesn't specifically deny you the ability to use iframes. However, it's very common that server security tools, such as mod_security, will deny use of things like iframe tags because that's how hackers often add rogue content to sites.

Contact your hosting company and ask them to remove the security protections from your site if that's REALLY what you want to do.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jul 2011, 3:36 PM
#3
samhughey avatar

samhughey

New Zenner

Join Date:
Aug 2010
Posts:
24
Plugin Contributions:
0

Re: iframe not allowed in product description?

Thanks, that convinces me to not use them.

18 Jul 2011, 3:42 PM
#4
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: iframe not allowed in product description?

Actually, it should convince you not to use iFrames. There is no need for them except for very certain situations; of which an eCommerce Product Info page is not one of.

Perhaps if you described what it is you are trying to do, people will offer more correct coding to do what you want?

The learning is in the doing.

Potent Products

18 Jul 2011, 4:38 PM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: iframe not allowed in product description?

I think I'll disagree with that. I can think of several legitimate reasons to use an iframe on the product info page, including assembly instruction videos and informational videos from Youtube.

18 Jul 2011, 5:00 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: iframe not allowed in product description?

Iframes are, in reality, a "clumsy" way of embedding data into a page, from an external source, and while I don't really like them, they are used in many instances - EG: even by Google (when you embed a MAP in your site you will use <iframe>).

It's more about WHERE and WHY you use them that matters.

In ZC, we use them exclusively on the define pages and EZ pages ONLY.

As DrByte says, IFRAME has a bad reputation.

And this is for two reasons:

  1. Microsoft invented them:yuck:
  2. Hackers like them because they can "spoof" a website.

Payment gateway providers hate them for reason "2", and the rest of the world hates them for reason "1".

20 years a Zencart User

26 Jul 2011, 8:17 AM
#7
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: iframe not allowed in product description?

could be that HTMLeditor removes the closing tag of the iframe before perview and iframe don't work without closing tags and casue display problems / page crash

could try
edit: editors/htmlarea/htmlarea.js

find

HTMLArea.needsClosingTag = function(el) {
var closingTags = " head script style div span tr td tbody table em strong font a title ";
return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
};

(line 3893)

add iframe
e.g.:

HTMLArea.needsClosingTag = function(el) {
 var closingTags = " iframe head script style div span tr td tbody table em strong font a title ";
 return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
};
26 Jul 2011, 8:27 AM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: iframe not allowed in product description?

schoolboy:

Payment gateway providers hate them for reason "2"Some payment gateway providers use them as it's a good way to collect card information straight to their servers without it ever being known to the store and therefore simplifies PCI compliance.

Kuroi Web Design and Development | Twitter

(Questions answered in the forum only - so that any forum member can benefit - not by personal message)

26 Jul 2011, 12:22 PM
#9
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: iframe not allowed in product description?

Perhaps it depends on who does the PCI scanning but TMK, iframes do not meet PCI Compliance. Using jQuery for a new Window is a much better alternative to iframes.

The learning is in the doing.

Potent Products

26 Jul 2011, 12:26 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: iframe not allowed in product description?

kuroi:

Some payment gateway providers use them as it's a good way to collect card information straight to their servers without it ever being known to the store and therefore simplifies PCI compliance.

Yes... SagePay is an example...

The difference is that THEY own the Iframe contents... not some stranger!

20 years a Zencart User