[-] 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 (!$this->isCached('blocknewproducts.tpl', $this->getCacheId()))
|
||||||
{
|
{
|
||||||
if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))
|
if (!Configuration::get('NEW_PRODUCTS_NBR'))
|
||||||
return;
|
return;
|
||||||
$newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR'));
|
$newProducts = false;
|
||||||
if (!$newProducts)
|
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;
|
return;
|
||||||
|
|
||||||
$this->smarty->assign(array(
|
$this->smarty->assign(array(
|
||||||
'new_products' => $newProducts,
|
'new_products' => $newProducts,
|
||||||
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
|
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
|
||||||
@@ -159,4 +160,4 @@ class BlockNewProducts extends Module
|
|||||||
{
|
{
|
||||||
$this->_clearCache('blocknewproducts.tpl');
|
$this->_clearCache('blocknewproducts.tpl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user