Skip to content
This repository was archived by the owner on Apr 30, 2023. It is now read-only.

AddToCart event is not fired when it's not default website #73

Open
qlhu opened this issue Aug 19, 2021 · 3 comments
Open

AddToCart event is not fired when it's not default website #73

qlhu opened this issue Aug 19, 2021 · 3 comments

Comments

@qlhu
Copy link

qlhu commented Aug 19, 2021

Precondition

  • A Magento installation has multiple websites
  • None Access-Control-Allow-Origin is set up for website
  • What customer visits is not the default website

Reproduce Steps

    • Visit any product page
    • Press Add to Cart button

Expect

  • AddToCart event is fired to Facebook

Actual

  • None event is fired to Facebook
  • The following error message presents in Browser Developer Tool > Console
    XMLHTTPRequest at 'https://XXX/fbe/Pixel/ProductInfoForAddToCart' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Investigation
The issue is at \Facebook\BusinessExtension\Helper\FBEHelper::getStore() function. It always return default store view instead of what customer is visiting.

@PotSchmoell
Copy link

Hi @qlhu,
we are currently having the same issue.
Did you receive any help or adivce? Or was there anything, that you could do to solve the issue?

Any help would be highly appreciated!

Thanks,
Patrick

@julionc
Copy link

julionc commented Apr 30, 2022

Related to #85

@designerdgr
Copy link

Anything new here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants