瀏覽代碼

Correctif deprecié

packProduct
Fabien Normand 3 年之前
父節點
當前提交
6bc49c1b02
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. +7
    -2
      Solver/Product/ProductFamilySolver.php

+ 7
- 2
Solver/Product/ProductFamilySolver.php 查看文件

@@ -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…
取消
儲存