taxHelper = $taxHelper; parent::__construct( $context, $customerSession, $checkoutSession, $priceCurrency, $data ); } /** * Get Shipping Price including or excluding tax * * @param bool $flag * @return float */ protected function getShippingPriceWithFlag($flag) { $price = $this->taxHelper->getShippingPrice( $this->getShippingRate()->getPrice(), $flag, $this->getAddress(), $this->getQuote()->getCustomerTaxClassId() ); return $this->priceCurrency->convertAndFormat( $price, true, PriceCurrencyInterface::DEFAULT_PRECISION, $this->getQuote()->getStore() ); } /** * Get shipping price excluding tax * * @return float */ public function getShippingPriceExclTax() { return $this->getShippingPriceWithFlag(false); } /** * Get shipping price including tax * * @return float */ public function getShippingPriceInclTax() { return $this->getShippingPriceWithFlag(true); } /** * Return flag whether to display shipping price including tax * * @return bool */ public function displayShippingPriceInclTax() { return $this->taxHelper->displayShippingPriceIncludingTax(); } /** * Return flag whether to display shipping price excluding tax * * @return bool */ public function displayShippingPriceExclTax() { return $this->taxHelper->displayShippingPriceExcludingTax(); } /** * Return flag whether to display shipping price including and excluding tax * * @return bool */ public function displayShippingBothPrices() { return $this->taxHelper->displayShippingBothPrices(); } }