getProductFamily()->getSaleStatus() != 1) { return false; } $allCategoriesSalesOff = true; $unavailableSpecificDay = false; foreach ($product->getProductFamily()->getProductCategories() as $category) { if ($category->getParent()) { if ($category->getSaleStatus() && $category->getParent()->getSaleStatus()) { $allCategoriesSalesOff = false; } } else { if ($category->getSaleStatus()) { $allCategoriesSalesOff = false; } } // specific day // @TODO : spécifique pdl ? $displaySpecificDay = $category->getDisplaySpecificDay(); if ($displaySpecificDay && $displaySpecificDay != date('N')) { $unavailableSpecificDay = true; } } if ($allCategoriesSalesOff) { return false; } if ($unavailableSpecificDay) { return false; } return true; } }