1515use Magento \Framework \Locale \Format ;
1616use Magento \Framework \Pricing \PriceCurrencyInterface ;
1717use Magento \Store \Model \Store ;
18- use Magento \Framework \App \Config \ScopeConfigInterface ;
19- use Magento \Tax \Model \Config ;
2018
2119/**
2220 * Confugurable product view type
2725 */
2826class Configurable extends \Magento \Catalog \Block \Product \View \AbstractView
2927{
30- private const XML_PATH_TAX_DISPLAY_TYPE = 'tax/display/type ' ;
31-
3228 /**
3329 * @var \Magento\Catalog\Helper\Product
3430 */
@@ -82,11 +78,6 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView
8278 */
8379 private $ variationPrices ;
8480
85- /**
86- * @var ScopeConfigInterface
87- */
88- private $ scopeConfig ;
89-
9081 /**
9182 * @param \Magento\Catalog\Block\Product\Context $context
9283 * @param \Magento\Framework\Stdlib\ArrayUtils $arrayUtils
@@ -100,7 +91,6 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView
10091 * @param Format|null $localeFormat
10192 * @param Session|null $customerSession
10293 * @param \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Variations\Prices|null $variationPrices
103- * @param ScopeConfigInterface|null $scopeConfig
10494 * @SuppressWarnings(PHPMD.ExcessiveParameterList)
10595 */
10696 public function __construct (
@@ -115,8 +105,7 @@ public function __construct(
115105 array $ data = [],
116106 Format $ localeFormat = null ,
117107 Session $ customerSession = null ,
118- \Magento \ConfigurableProduct \Model \Product \Type \Configurable \Variations \Prices $ variationPrices = null ,
119- ?ScopeConfigInterface $ scopeConfig = null
108+ \Magento \ConfigurableProduct \Model \Product \Type \Configurable \Variations \Prices $ variationPrices = null
120109 ) {
121110 $ this ->priceCurrency = $ priceCurrency ;
122111 $ this ->helper = $ helper ;
@@ -129,7 +118,6 @@ public function __construct(
129118 $ this ->variationPrices = $ variationPrices ?: ObjectManager::getInstance ()->get (
130119 \Magento \ConfigurableProduct \Model \Product \Type \Configurable \Variations \Prices::class
131120 );
132- $ this ->scopeConfig = $ scopeConfig ?: ObjectManager::getInstance ()->get (ScopeConfigInterface::class);
133121
134122 parent ::__construct (
135123 $ context ,
@@ -344,38 +332,29 @@ private function getTierPricesByProduct(ProductInterface $product): array
344332 $ tierPrices = [];
345333 $ tierPriceModel = $ product ->getPriceInfo ()->getPrice ('tier_price ' );
346334 foreach ($ tierPriceModel ->getTierPriceList () as $ tierPrice ) {
347- $ price = $ this ->localeFormat ->getNumber ($ tierPrice ['price ' ]->getValue ());
348- if ($ this ->getConfigTaxDisplayType () === Config::DISPLAY_TYPE_EXCLUDING_TAX ) {
349- $ price = $ this ->localeFormat ->getNumber ($ tierPrice ['price ' ]->getBaseAmount ());
350- }
351335 $ tierPriceData = [
352336 'qty ' => $ this ->localeFormat ->getNumber ($ tierPrice ['price_qty ' ]),
353- 'price ' => $ price ,
337+ 'price ' => $ this -> localeFormat -> getNumber ( $ tierPrice [ ' price ' ]-> getValue ()) ,
354338 'percentage ' => $ this ->localeFormat ->getNumber (
355339 $ tierPriceModel ->getSavePercent ($ tierPrice ['price ' ])
356340 ),
357341 ];
358342
359343 if (isset ($ tierPrice ['excl_tax_price ' ])) {
360- $ excludingTax = $ tierPrice ['excl_tax_price ' ];
361- $ tierPriceData ['excl_tax_price ' ] = $ this ->localeFormat ->getNumber ($ excludingTax ->getBaseAmount ());
344+ $ exclTax = $ tierPrice ['excl_tax_price ' ];
345+ $ tierPriceData ['excl_tax_price ' ] = $ this ->localeFormat ->getNumber ($ exclTax ->getBaseAmount ());
346+ }
347+
348+ if (isset ($ tierPrice ['incl_excl_tax_price ' ])) {
349+ $ inclExclTax = $ tierPrice ['incl_excl_tax_price ' ];
350+ $ tierPriceData ['incl_excl_tax_price ' ] = $ this ->localeFormat ->getNumber ($ inclExclTax ->getBaseAmount ());
362351 }
363352 $ tierPrices [] = $ tierPriceData ;
364353 }
365354
366355 return $ tierPrices ;
367356 }
368357
369- /**
370- * Returns config tax display type
371- *
372- * @return int
373- */
374- private function getConfigTaxDisplayType (): int
375- {
376- return (int ) $ this ->scopeConfig ->getValue (self ::XML_PATH_TAX_DISPLAY_TYPE );
377- }
378-
379358 /**
380359 * Replace ',' on '.' for js
381360 *
0 commit comments