facebook-for-magento2 icon indicating copy to clipboard operation
facebook-for-magento2 copied to clipboard

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

Open qlhu opened this issue 4 years ago • 3 comments

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.

qlhu avatar Aug 19 '21 08:08 qlhu

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

PotSchmoell avatar Apr 26 '22 12:04 PotSchmoell

Related to #85

julionc avatar Apr 30 '22 00:04 julionc

Anything new here?

designerdgr avatar Nov 01 '22 14:11 designerdgr