Guillaume преди 3 години
родител
ревизия
56cd009e7c
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. +4
    -3
      Solver/Product/ProductFamilySolver.php

+ 4
- 3
Solver/Product/ProductFamilySolver.php Целия файл

@@ -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…
Отказ
Запис