@@ -191,12 +191,12 @@ class ProductFamilySolver | |||
} | |||
public function getProductCategoryChild(ProductFamilyInterface $productFamily) | |||
public function getProductCategoryChild(ProductFamilyInterface $productFamily, SectionInterface $section) | |||
{ | |||
$productCategories = $productFamily->getProductCategories(); | |||
foreach ($productCategories as $productCategory) { | |||
if ($productCategory->getParent()) { | |||
if ($productCategory->getParent() && $productCategory->getSection() == $section) { | |||
return $productCategory; | |||
} | |||
} |