![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/Ecombricks/InventoryTax/Model/Product/Checkout/ |
<?php /** * Copyright © eComBricks. All rights reserved. * See LICENSE.txt for license details. */ namespace Ecombricks\InventoryTax\Model\Product\Checkout; /** * Tax product checkout config provider */ class TaxConfigProvider extends \Magento\Tax\Model\TaxConfigProvider implements \Magento\Checkout\Model\ConfigProviderInterface { /** * Get config value * * @param string $path * @return mixed */ protected function getConfigValue($path) { return $this->scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE); } /** * Get default region ID * * @return mixed */ protected function getDefaultRegionId() { $defaultRegionId = $this->getConfigValue(\Magento\Tax\Model\Config::CONFIG_XML_PATH_DEFAULT_REGION); if (0 == $defaultRegionId) { return null; } return $defaultRegionId; } /** * Get config * * @return array|mixed * @throws \Magento\Framework\Exception\NoSuchEntityException */ public function getConfig() { return [ 'isDisplayShippingPriceExclTax' => $this->isDisplayShippingPriceExclTax(), 'isDisplayShippingBothPrices' => $this->isDisplayShippingBothPrices(), 'reviewShippingDisplayMode' => $this->getDisplayShippingMode(), 'reviewTotalsDisplayMode' => $this->getReviewTotalsDisplayMode(), 'includeTaxInGrandTotal' => $this->isTaxDisplayedInGrandTotal(), 'isFullTaxSummaryDisplayed' => $this->isFullTaxSummaryDisplayed(), 'isZeroTaxDisplayed' => $this->taxConfig->displayCartZeroTax(), 'defaultCountryId' => $this->getConfigValue(\Magento\Tax\Model\Config::CONFIG_XML_PATH_DEFAULT_COUNTRY), 'defaultRegionId' => $this->getDefaultRegionId(), 'defaultPostcode' => $this->getConfigValue(\Magento\Tax\Model\Config::CONFIG_XML_PATH_DEFAULT_POSTCODE), ]; } }