I want to display feefo carousal widget on my website. For that I have generate the widget code and trying to add on my magento 1.9 website. But Feefo widget JS is conflict with the prototype.js and raised the below error in console,
Error 1
feefo-widget.js:53 Uncaught TypeError: Array.prototype.map callback must be a function
at Array.map (feefo-widget.js:53)
at Array.toArray (prototype.js:1002)
at t.exports (feefo-widget.js:48)
at Object.<anonymous> (feefo-widget.js:41)
at o (feefo-widget.js:1)
at Object.<anonymous> (feefo-widget.js:41)
at o (feefo-widget.js:1)
at Object.<anonymous> (feefo-widget.js:48)
at o (feefo-widget.js:1)
at Object.<anonymous> (feefo-widget.js:48)
map @ feefo-widget.js:53
toArray @ prototype.js:1002
t.exports @ feefo-widget.js:48
(anonymous) @ feefo-widget.js:41
o @ feefo-widget.js:1
(anonymous) @ feefo-widget.js:41
o @ feefo-widget.js:1
(anonymous) @ feefo-widget.js:48
o @ feefo-widget.js:1
(anonymous) @ feefo-widget.js:48
o @ feefo-widget.js:1
(anonymous) @ feefo-widget.js:53
o @ feefo-widget.js:1
(anonymous) @ feefo-widget.js:1
(anonymous) @ feefo-widget.js:1
Error 2
enter code here
feefo.js:8 Uncaught ReferenceError: feefoWidget is not defined
at HTMLScriptElement.feefoWidgetScript.onload (feefo.js:8)
Please help me to fix this issue? I have tried but no solution found. Thanks in advance.
2 Answers 2
We had the same error. Seems Feefo is not compatible with the default prototype 1.7 which is included in Magento v1. You could show the widgets using iframes (this may scupper the SEO potential) or you could fix it by updating prototype:
This module does the job: https://github.com/leytech/Leytech_PrototypeUpdate
Although for php version below 5.6 you will need to change the CONSTANT declaration for the allowed versions to a variable rather than a constant and then again where it is used lower down in the /app/code/community/Leytech/Helper/Data.php
Feefo official response is to upgrade prototype
Feefo integration widgets and carousels are supported on websites using Prototype JavaScript Framework 1.7.3.
Websites using earlier versions of the Prototype JavaScript Framework may experience unpredictable behaviour and therefore we would advise upgrading to the latest version.
Obviously that could cause more issues that it solves bit it's a potential answer