|
8 | 8 | use Magento\Catalog\Helper\Product\Configuration\ConfigurationInterface;
|
9 | 9 | use Magento\Catalog\Model\Product\Configuration\Item\ItemInterface;
|
10 | 10 | 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; |
11 | 16 |
|
12 | 17 | /**
|
13 | 18 | * Helper for fetching properties by product configuration item
|
@@ -44,25 +49,33 @@ class Configuration extends AbstractHelper implements ConfigurationInterface
|
44 | 49 | */
|
45 | 50 | private $serializer;
|
46 | 51 |
|
| 52 | + /** |
| 53 | + * @var \Magento\Catalog\Helper\Data |
| 54 | + */ |
| 55 | + private $catalogHelper; |
| 56 | + |
47 | 57 | /**
|
48 | 58 | * @param \Magento\Framework\App\Helper\Context $context
|
49 | 59 | * @param \Magento\Catalog\Helper\Product\Configuration $productConfiguration
|
50 | 60 | * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
|
51 | 61 | * @param \Magento\Framework\Escaper $escaper
|
52 | 62 | * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
|
| 63 | + * @param \Magento\Catalog\Helper\Data|null $catalogHelper |
53 | 64 | */
|
54 | 65 | public function __construct(
|
55 | 66 | \Magento\Framework\App\Helper\Context $context,
|
56 | 67 | \Magento\Catalog\Helper\Product\Configuration $productConfiguration,
|
57 | 68 | \Magento\Framework\Pricing\Helper\Data $pricingHelper,
|
58 | 69 | \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 |
60 | 72 | ) {
|
61 | 73 | $this->productConfiguration = $productConfiguration;
|
62 | 74 | $this->pricingHelper = $pricingHelper;
|
63 | 75 | $this->escaper = $escaper;
|
64 | 76 | $this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
|
65 | 77 | ->get(\Magento\Framework\Serialize\Serializer\Json::class);
|
| 78 | + $this->catalogHelper = $catalogHelper ?? ObjectManager::getInstance()->get(\Magento\Catalog\Helper\Data::class); |
66 | 79 | parent::__construct($context);
|
67 | 80 | }
|
68 | 81 |
|
@@ -97,14 +110,16 @@ public function getSelectionFinalPrice(ItemInterface $item, \Magento\Catalog\Mod
|
97 | 110 | /** @var \Magento\Bundle\Model\Product\Price $price */
|
98 | 111 | $price = $product->getPriceModel();
|
99 | 112 |
|
100 |
| - return $price->getSelectionFinalTotalPrice( |
| 113 | + $selectionPrice = $price->getSelectionFinalTotalPrice( |
101 | 114 | $product,
|
102 | 115 | $selectionProduct,
|
103 | 116 | $item->getQty(),
|
104 | 117 | $this->getSelectionQty($product, $selectionProduct->getSelectionId()),
|
105 | 118 | false,
|
106 | 119 | true
|
107 | 120 | );
|
| 121 | + |
| 122 | + return $this->catalogHelper->getTaxPrice($selectionProduct, $selectionPrice); |
108 | 123 | }
|
109 | 124 |
|
110 | 125 | /**
|
|
0 commit comments