|
|
@@ -14,7 +14,6 @@ use Lc\CaracoleBundle\Model\Section\SectionInterface; |
|
|
|
|
|
|
|
class ProductFamilySolver |
|
|
|
{ |
|
|
|
|
|
|
|
protected ProductSolver $productSolver; |
|
|
|
protected ProductFamilySectionPropertySolver $productFamilySectionPropertySolver; |
|
|
|
protected ProductCategorySolver $productCategorySolver; |
|
|
@@ -26,7 +25,6 @@ class ProductFamilySolver |
|
|
|
$this->productCategorySolver = $productCategorySolver; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static function getBehaviorCountStockChoices(): array |
|
|
|
{ |
|
|
|
return [ |
|
|
@@ -170,24 +168,24 @@ class ProductFamilySolver |
|
|
|
return $productsOnlineArray; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getReductionCatalogInherited(ProductFamilyInterface $productFamily): ?ReductionCatalogInterface |
|
|
|
{ |
|
|
|
return $productFamily->getReductionCatalog(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily, SectionInterface $section) |
|
|
|
{ |
|
|
|
$productCategories = $productFamily->getProductCategories(); |
|
|
|
|
|
|
|
if (count($productCategories) > 0) { |
|
|
|
|
|
|
|
foreach ($productCategories as $productCategory) { |
|
|
|
if($productCategory->getSection() === $section && $productCategory->getParent()!==null){ |
|
|
|
if($productCategory->getSection()->getId() == $section->getId() |
|
|
|
&& $productCategory->getParent() !== null) { |
|
|
|
|
|
|
|
return $productCategory->getParent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |