|
|
@@ -177,12 +177,17 @@ class ProductFamilySolver |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily) |
|
|
|
public function getProductCategoryParent(ProductFamilyInterface $productFamily, SectionInterface $section) |
|
|
|
{ |
|
|
|
$productCategories = $productFamily->getProductCategories(); |
|
|
|
|
|
|
|
if (count($productCategories) > 0) { |
|
|
|
return $productCategories[0]->getParent(); |
|
|
|
foreach ($productCategories as $productCategory) { |
|
|
|
if($productCategory->getSection() === $section && $productCategory->getParent()!==null){ |
|
|
|
return $productCategory->getParent(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |