Browse Source

Correctif deprecié

packProduct
Fabien Normand 3 years ago
parent
commit
6bc49c1b02
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      Solver/Product/ProductFamilySolver.php

+ 7
- 2
Solver/Product/ProductFamilySolver.php View File

} }




public function getProductCategoryParent(ProductFamilyInterface $productFamily)
public function getProductCategoryParent(ProductFamilyInterface $productFamily, SectionInterface $section)
{ {
$productCategories = $productFamily->getProductCategories(); $productCategories = $productFamily->getProductCategories();


if (count($productCategories) > 0) { if (count($productCategories) > 0) {
return $productCategories[0]->getParent();
foreach ($productCategories as $productCategory) {
if($productCategory->getSection() === $section && $productCategory->getParent()!==null){
return $productCategory->getParent();
}
}

} }


return false; return false;

Loading…
Cancel
Save