Sfoglia il codice sorgente

Correctif deprecié

packProduct
Fabien Normand 3 anni fa
parent
commit
6bc49c1b02
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. +7
    -2
      Solver/Product/ProductFamilySolver.php

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

@@ -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;

Loading…
Annulla
Salva