Skip to content

Commit beffa73

Browse files
committed
ACP2E-1456: display bundle options taking into account tax configurations
1 parent a3b838a commit beffa73

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
use Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface;
99
use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
1010
use Magento\Framework\App\Helper\AbstractHelper;
11+
use Magento\Framework\App\Helper\Context;
12+
use Magento\Framework\App\ObjectManager;
13+
use Magento\Framework\Escaper;
14+
use Magento\Framework\Pricing\Helper\Data;
15+
use Magento\Framework\Serialize\Serializer\Json;
1116

1217
/**
1318
* Helper for fetching properties by product configuration item
@@ -44,25 +49,33 @@ class Configuration extends AbstractHelper implements ConfigurationInterface
4449
*/
4550
private $serializer;
4651

52+
/**
53+
* @var \Magento\Catalog\Helper\Data
54+
*/
55+
private $catalogHelper;
56+
4757
/**
4858
* @param \Magento\Framework\App\Helper\Context $context
4959
* @param \Magento\Catalog\Helper\Product\Configuration $productConfiguration
5060
* @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
5161
* @param \Magento\Framework\Escaper $escaper
5262
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
63+
* @param \Magento\Catalog\Helper\Data|null $catalogHelper
5364
*/
5465
public function __construct(
5566
\Magento\Framework\App\Helper\Context $context,
5667
\Magento\Catalog\Helper\Product\Configuration $productConfiguration,
5768
\Magento\Framework\Pricing\Helper\Data $pricingHelper,
5869
\Magento\Framework\Escaper $escaper,
59-
\Magento\Framework\Serialize\Serializer\Json $serializer = null
70+
\Magento\Framework\Serialize\Serializer\Json $serializer = null,
71+
\Magento\Catalog\Helper\Data $catalogHelper = null
6072
) {
6173
$this->productConfiguration = $productConfiguration;
6274
$this->pricingHelper = $pricingHelper;
6375
$this->escaper = $escaper;
6476
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
6577
->get(\Magento\Framework\Serialize\Serializer\Json::class);
78+
$this->catalogHelper = $catalogHelper ?? ObjectManager::getInstance()->get(\Magento\Catalog\Helper\Data::class);
6679
parent::__construct($context);
6780
}
6881

@@ -97,14 +110,16 @@ public function getSelectionFinalPrice(ItemInterface $item, \Magento\Catalog\Mod
97110
/** @var \Magento\Bundle\Model\Product\Price $price */
98111
$price = $product->getPriceModel();
99112

100-
return $price->getSelectionFinalTotalPrice(
113+
$selectionPrice = $price->getSelectionFinalTotalPrice(
101114
$product,
102115
$selectionProduct,
103116
$item->getQty(),
104117
$this->getSelectionQty($product, $selectionProduct->getSelectionId()),
105118
false,
106119
true
107120
);
121+
122+
return $this->catalogHelper->getTaxPrice($selectionProduct, $selectionPrice);
108123
}
109124

110125
/**

0 commit comments

Comments
 (0)