[-] FO: Fix bug #PSCFV-10623 blocknewproducts shows products when PS_NB_DAYS_NEW_PRODUCT == 0
This commit is contained in:
@@ -111,12 +111,13 @@ class BlockNewProducts extends Module
|
||||
{
|
||||
if (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
||||
{
|
||||
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
|
||||
if (!Configuration::get('NEW_PRODUCTS_NBR'))
|
||||
return;
|
||||
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR'));
|
||||
if (!$newProducts)
|
||||
$newProducts = false;
|
||||
if (Configuration::get('PS_NB_DAYS_NEW_PRODUCT'))
|
||||
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int)Configuration::get('NEW_PRODUCTS_NBR'));
|
||||
if (!$newProducts && !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
|
||||
return;
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'new_products' => $newProducts,
|
||||
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
|
||||
@@ -159,4 +160,4 @@ class BlockNewProducts extends Module
|
||||
{
|
||||
$this->_clearCache('blocknewproducts.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user