Skip to content

Add to cart doesn't work inside an iframe in IE #5039

Closed
@MidnightDesign

Description

@MidnightDesign

Steps to reproduce

  1. Load an M2 store inside an Iframe in IE11
  2. Try to add a product to the cart

Expected result

The product is added to the cart

Actual result

The product isn't added to the cart and the "Add to cart" button stays grayed out saying "Adding...".

I've tracked the problem down to the form key Validator returning false because the request's form_key is different from the session's.

Some additional info:

  • The Iframe is on a different origin than the page that contains it. (I commented out Header set X-Frame-Options SAMEORIGIN in pub/.htaccess)
  • Both the containing page and the Magento store inside the Iframe are served via HTTPS.
  • In Chrome it works fine.

I know we're doing something pretty particular here, but maybe someone can help me anyway.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions