gzonebg Posted February 18, 2023 Share Posted February 18, 2023 Hello everyone, some days ago fancy box popup on my product page stopped working, when i click on the product image, there is no popup. In the "Products" page under the "Preferences" menu, Enable JqZoom instead of Fancybox on the product page is set to No. If i set this option to yes, JqZoom works. But if i set it to no, fancy box doesn’t work. I use the default bootstrap theme. url: https://puloveri.com/ By clicking on the product image by right mouse button and choose Inspect, appears following errors: Uncaught TypeError: Cannot read properties of null (reading 'products') at HTMLDocument.<anonymous> (1212-luxury-men-s-cardigan-with-zipper-and-pockets-2309-1.html:441:54) at HTMLDocument.dispatch (jquery-1.11.0.min.js:3:8066) at r.handle (jquery-1.11.0.min.js:3:4767) at Object.trigger (jquery-1.11.0.min.js:3:7167) at e.event.trigger (jquery-migrate-1.2.1.min.js:2:6732) at x (jquery-1.11.0.min.js:4:22396) at b (jquery-1.11.0.min.js:4:26298) at Object.send (jquery-1.11.0.min.js:4:26402) at Function.ajax (jquery-1.11.0.min.js:4:21703) at HTMLAnchorElement.<anonymous> (1212-luxury-men-s-cardigan-with-zipper-and-pockets-2309-1.html:934:15) Does anyone know how to resolve this? Thank you in advance! Link to comment Share on other sites More sharing options...
Nickz Posted February 18, 2023 Share Posted February 18, 2023 1 hour ago, gzonebg said: In the "Products" page under the "Preferences" menu, Enable JqZoom instead of Fancybox on the product page is set to No. Since when? When did started that behavior change. Are you on a shared server? Link to comment Share on other sites More sharing options...
gzonebg Posted February 18, 2023 Author Share Posted February 18, 2023 This has been the case since 5-6 days ago. And I'm not on a shared server. Link to comment Share on other sites More sharing options...
gzonebg Posted February 18, 2023 Author Share Posted February 18, 2023 Here's something new. I added a new product and the first time I clicked on the product image it enlarged. On my next attempts it no longer works. Link to comment Share on other sites More sharing options...
gzonebg Posted March 2, 2023 Author Share Posted March 2, 2023 I found a solution! Everyting comes from a module Pixel Plus: Events + CAPI + Pixel Catalog for Facebook, version v2.4.3. The solution of the problem is as follows: in FILE: modules/facebookconversiontrackingplus/views/templates/hook/addtocart.tpl LINE 96 - OLD text: if (r !== undefined && (typeof r.products === 'object') && r.products.length > 0) { NEW FIXED CODE: if (r !== undefined && r !== null && (typeof r.products === 'object') && r.products.length > 0) { I have to add "&& r !== null" to prevent JS ERROR due to some other modules returning null response to ajax calls intercepted by Pixel Plus on line 96 above ... Such a check: "r !== null" is quite harmless, won't introduce any new bugs, but saves you lots of potential trouble. I've tested it and works like a charm. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now