Matrice – Prestashop 1.4.3 – Undefined variable: nb_products FIX

I am rebuilding one of our webshops and run into this nasty error when clicking on the home category from the TOP navigation menu.

Notice: Undefined variable: nb_products in /var/www/html/shopname/tools/smarty/sysplugins/smarty_internal_data.php on line 291 There are no products.

We are using the Matrice theme which is truly amazing however there seems to be an issue here with it. If you run into the same as a quick fix just change the following in the category.tpl:

 

{if $nb_products == 0}{l s=’There are no products.’}

{else}

{if $nb_products == 1}{l s=’There is’}{else}{l s=’There are’}{/if} 
{$nb_products} 
{if $nb_products == 1}{l s=’product.’}{else}{l s=’products.’}{/if}

{/if}

 

to

<!–

{if $nb_products == 0}{l s=’There are no products.’}

{else}

–>

{if $nb_products == 1}{l s=’There is’}{else}{l s=’There are’}{/if}&#160;
{$nb_products}&#160;
{if $nb_products == 1}{l s=’product.’}{else}{l s=’products.’}{/if}
<!–

{/if}

–>

Make sure that you are changing the Matrice theme not the default one 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.