Browse Source

Correctif

packProduct
Guillaume 3 years ago
parent
commit
56cd009e7c
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      Solver/Product/ProductFamilySolver.php

+ 4
- 3
Solver/Product/ProductFamilySolver.php View File

@@ -94,11 +94,10 @@ class ProductFamilySolver
$products = $this->getProductsOnline($productFamily)->getValues();
if (count($products) > 0) {
usort($products, $comparisonFunction);

return $products[0];
}
} else {
return $this->getOriginProduct($returnSelfIfNotActiveProducts);
return $this->getOriginProduct($productFamily);
}
if ($returnSelfIfNotActiveProducts) {
return $productFamily;
@@ -271,7 +270,7 @@ class ProductFamilySolver
}


public function getOriginProduct(ProductFamilyInterface $productFamily): ProductInterface
public function getOriginProduct(ProductFamilyInterface $productFamily): ?ProductInterface
{
$products = $productFamily->getProducts();

@@ -280,6 +279,8 @@ class ProductFamilySolver
return $product;
}
}

return null;
}



Loading…
Cancel
Save