replace this function in /src/Adapter/Product/QueryHandler/SearchProductsHandler.php on line 273
private function getProductCombinations(
Product $product,
string $currencyIsoCode,
int $computingPrecision,
?Order $order = null
😞 array {
$productCombinations = [];
$combinations = $product->getAttributeCombinations();
if (false !== $combinations) {
foreach ($combinations as $combination) {
$productAttributeId = (int) $combination['id_product_attribute'];
if ( $combination['attribute_name'] == null) {
$attribute = '-';
} else {
$attribute = $combination['attribute_name'];
}
if (isset($productCombinations[$productAttributeId])) {
$existingAttribute = $productCombinations[$productAttributeId]->getAttribute();
$attribute = $existingAttribute . ' - ' . $attribute;
}
$priceTaxExcluded = $this->getProductPriceForOrder((int) $product->id, $productAttributeId, false, $computingPrecision, $order);
$priceTaxIncluded = $this->getProductPriceForOrder((int) $product->id, $productAttributeId, true, $computingPrecision, $order);
$productCombination = new ProductCombination(
$productAttributeId,
$attribute,
$combination['quantity'],
$this->contextLocale->formatPrice($priceTaxExcluded, $currencyIsoCode),
$priceTaxExcluded,
$priceTaxIncluded,
$combination['location'],
$combination['reference']
);
$productCombinations[$productCombination->getAttributeCombinationId()] = $productCombination;
}
}
return $productCombinations;
}