diff --git a/modules/blocknewproducts/blocknewproducts.php b/modules/blocknewproducts/blocknewproducts.php index d5ca90eda..ae04a77ee 100644 --- a/modules/blocknewproducts/blocknewproducts.php +++ b/modules/blocknewproducts/blocknewproducts.php @@ -111,7 +111,10 @@ class BlockNewProducts extends Module { if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId())) { - if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY') && !($newProducts = Product::getNewProducts((int)$params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR')))) + if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY')) + return; + $newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR')); + if (!$newProducts) return; $this->smarty->assign(array( @@ -151,4 +154,4 @@ class BlockNewProducts extends Module { $this->_clearCache('blocknewproducts.tpl'); } -} \ No newline at end of file +}