Skip to content

Commit 76cd281

Browse files
Fix bundle product pricing in feed using indexed prices
Dynamic bundle min/max prices now use indexed data ($product->getData('min_price')) instead of getBaseAmount(), matching how configurables are handled. This ensures correct tax calculation via getTaxPrice() regardless of the price_includes_tax setting. Also fixes processPrice passing an array instead of boolean to getTaxPrice's third parameter, which caused inconsistent tax behavior across Magento versions.
1 parent 226599b commit 76cd281

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Service/Product/PriceData.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ public function execute(array $config, Product $product): array
9292
case 'bundle':
9393
$price = $product->getPrice();
9494
if ((int)$product->getPriceType() === Price::PRICE_TYPE_DYNAMIC) {
95-
$product['min_price'] = $product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()->getBaseAmount();
96-
$product['max_price'] = $product->getPriceInfo()->getPrice('final_price')->getMaximalPrice()->getBaseAmount();
95+
$product['min_price'] = $product->getData('min_price');
96+
$product['max_price'] = $product->getData('max_price');
97+
$finalPrice = $product->getData('final_price') ?: $product->getData('min_price');
98+
} else {
99+
$finalPrice = $product->getFinalPrice();
97100
}
98-
$finalPrice = $product->getFinalPrice();
99101
$specialPrice = $product->getSpecialPrice();
100102
$rulePrice = $this->ruleFactory->create()->getRulePrice(
101103
$config['timestamp'],
@@ -294,7 +296,7 @@ public function processPrice(Product $product, $price, array $config, ?bool $inc
294296
}
295297

296298
if (isset($config['incl_vat'])) {
297-
$price = $this->catalogHelper->getTaxPrice($product, $price, ['incl_vat']);
299+
$price = $this->catalogHelper->getTaxPrice($product, $price, true);
298300
}
299301

300302
return $this->formatPrice($price, $config);

0 commit comments

Comments
 (0)