Results 1 to 10 of 10
  1. #1

    Default 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

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

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

  3. #3

    Default Re: iframe not allowed in product description?

    Thanks, that convinces me to not use them.

  4. #4
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default 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?

  5. #5
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

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

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default 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
    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

  7. #7
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default 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

    PHP Code:
    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.:
    PHP Code:
    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);
    }; 

  8. #8
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: iframe not allowed in product description?

    Quote Originally Posted by schoolboy View Post
    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)

  9. #9
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

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

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,267
    Plugin Contributions
    3

    Default Re: iframe not allowed in product description?

    Quote Originally Posted by kuroi View Post
    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

 

 

Similar Threads

  1. Product Info: product name and description not saving
    By sharc316 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 27 Sep 2011, 04:56 PM
  2. Iframe in product description hides admin update button
    By NadiaUSA in forum General Questions
    Replies: 3
    Last Post: 26 Jul 2011, 01:42 PM
  3. Replies: 3
    Last Post: 30 Jun 2008, 04:57 AM
  4. Product description in product more info in html format but not in product listing?
    By this side up in forum Customization from the Admin
    Replies: 1
    Last Post: 18 Dec 2006, 06:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg