Categories

Featured templates

PrestaShop 1.6.x. Troubleshooter. How to fix “comparedProductsIds is not defined” console error

Vincent White August 11, 2015
Rating: 5.0/5. From 1 vote.
Please wait...

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.

  1. Enter your website URL and click F12 to open the browser console.

  2. Refresh the page and wait until the error appear to be sure you have it on your website.

    prestashop_troubleshooter_how_to_fix_comparedProductsIds_is_not_defined1

  3. 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.

  4. Navigate to themes/themeXXX/ (where xxx is you current theme number) directory and open index.tpl file.

    prestashop_troubleshooter_how_to_fix_comparedProductsIds_is_not_defined2

  5. Found the function:

    {if isset($HOOK_HOME_TAB_CONTENT) && $HOOK_HOME_TAB_CONTENT|trim}
    
    {/if}
    
  6. Add the following code before closing {/if}:

    {addJsDef comparedProductsIds=$compared_products}
    

    prestashop_troubleshooter_how_to_fix_comparedProductsIds_is_not_defined3

  7. Save changes.

  8. Log into your admin panel and navigate to Advanced Parameters -> Performance. Disable Cache, clear it and re-enable. Save changes.

    prestashop_troubleshooter_how_to_fix_comparedProductsIds_is_not_defined4

    Feel free to check the detailed video tutorial how to clear Smarty cache manually.

  9. 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

Premium Prestashop Templates
This entry was posted in PrestaShop Tutorials and tagged compared, error, Prestashop, product, troubleshooter. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket