- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
PrestaShop 1.6.x. Troubleshooter. How to fix “comparedProductsIds is not defined” console error
August 11, 2015
The following tutorial is going to show how to fix comparedProductsIds is not defined error.
PrestaShop 1.6.x. Troubleshooter. How to fix “comparedProductsIds is not defined” console error
NOTE: You can see the error only in the browser console. Please, check the following tutorial for more details concerning the browser developer tools. On the frontend the error prevents some scripts, like the slider animation, top menu dropdowns, missing home page products, from working.
IMPORTANT: The error appears only, when Cache enabled in Advanced Parameters -> Performance.
-
Enter your website URL and click F12 to open the browser console.
-
Refresh the page and wait until the error appear to be sure you have it on your website.
-
Go to your server with PrestaShop installation via FTP (using some FTP-software, like Total Commander or Filezilla) or File manager in the hosting Cpanel.
-
Navigate to themes/themeXXX/ (where xxx is you current theme number) directory and open index.tpl file.
-
Found the function:
{if isset($HOOK_HOME_TAB_CONTENT) && $HOOK_HOME_TAB_CONTENT|trim} {/if}
-
Add the following code before closing {/if}:
{addJsDef comparedProductsIds=$compared_products}
-
Save changes.
-
Log into your admin panel and navigate to Advanced Parameters -> Performance. Disable Cache, clear it and re-enable. Save changes.
Feel free to check the detailed video tutorial how to clear Smarty cache manually.
-
Go back to your website and refresh the page. The issue is resolved now.
That is the end of the tutorial. Now you know how to fix comparedProductsIds is not defined error.
Feel free to check the detailed video tutorial below:
PrestaShop 1.6.x. Troubleshooter. How to fix “comparedProductsIds is not defined” console error