|
15 | 15 | use Magento\Catalog\Pricing\Price\CalculateCustomOptionCatalogRule;
|
16 | 16 | use Magento\Catalog\Pricing\Price\CustomOptionPriceInterface;
|
17 | 17 | use Magento\Framework\App\ObjectManager;
|
18 |
| -use Magento\Framework\Pricing\Adjustment\CalculatorInterface; |
19 | 18 |
|
20 | 19 | /**
|
21 | 20 | * Product options section abstract block.
|
@@ -55,33 +54,24 @@ abstract class AbstractOptions extends \Magento\Framework\View\Element\Template
|
55 | 54 | */
|
56 | 55 | private $calculateCustomOptionCatalogRule;
|
57 | 56 |
|
58 |
| - /** |
59 |
| - * @var CalculatorInterface |
60 |
| - */ |
61 |
| - protected $calculator; |
62 |
| - |
63 | 57 | /**
|
64 | 58 | * @param \Magento\Framework\View\Element\Template\Context $context
|
65 | 59 | * @param \Magento\Framework\Pricing\Helper\Data $pricingHelper
|
66 | 60 | * @param \Magento\Catalog\Helper\Data $catalogData
|
67 | 61 | * @param array $data
|
68 | 62 | * @param CalculateCustomOptionCatalogRule|null $calculateCustomOptionCatalogRule
|
69 |
| - * @param CalculatorInterface|null $calculator |
70 | 63 | */
|
71 | 64 | public function __construct(
|
72 | 65 | \Magento\Framework\View\Element\Template\Context $context,
|
73 | 66 | \Magento\Framework\Pricing\Helper\Data $pricingHelper,
|
74 | 67 | \Magento\Catalog\Helper\Data $catalogData,
|
75 | 68 | array $data = [],
|
76 |
| - CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null, |
77 |
| - CalculatorInterface $calculator = null |
| 69 | + CalculateCustomOptionCatalogRule $calculateCustomOptionCatalogRule = null |
78 | 70 | ) {
|
79 | 71 | $this->pricingHelper = $pricingHelper;
|
80 | 72 | $this->_catalogHelper = $catalogData;
|
81 | 73 | $this->calculateCustomOptionCatalogRule = $calculateCustomOptionCatalogRule
|
82 | 74 | ?? ObjectManager::getInstance()->get(CalculateCustomOptionCatalogRule::class);
|
83 |
| - $this->calculator = $calculator |
84 |
| - ?? ObjectManager::getInstance()->get(CalculatorInterface::class); |
85 | 75 | parent::__construct($context, $data);
|
86 | 76 | }
|
87 | 77 |
|
@@ -199,7 +189,7 @@ protected function _formatPrice($value, $flag = true)
|
199 | 189 | $context = [CustomOptionPriceInterface::CONFIGURATION_OPTION_FLAG => true];
|
200 | 190 | $optionAmount = !$isPercent
|
201 | 191 | ? $customOptionPrice->getCustomAmount($value['pricing_value'], null, $context)
|
202 |
| - : $this->calculator->getAmount($value['pricing_value'], $this->getProduct(), null, $context); |
| 192 | + : $customOptionPrice->getCustomRoundAmount($value['pricing_value'], $context); |
203 | 193 | $priceStr .= $this->getLayout()->getBlock('product.price.render.default')->renderAmount(
|
204 | 194 | $optionAmount,
|
205 | 195 | $customOptionPrice,
|
|
0 commit comments