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