/**
  * Check if tax calculation type and price display settings are compatible
  *
  * Invalid settings if
  *      Tax Calculation Method Based On 'Total' or 'Row'
  *      and at least one Price Display Settings has 'Including and Excluding Tax' value
  *
  * @param null|int|bool|string|\Magento\Store\Model\Store $store $store
  * @return bool
  */
 public function checkDisplaySettings($store = null)
 {
     if ($this->taxConfig->getAlgorithm($store) == \Magento\Tax\Model\Calculation::CALC_UNIT_BASE) {
         return true;
     }
     return $this->taxConfig->getPriceDisplayType($store) != \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH && $this->taxConfig->getShippingPriceDisplayType($store) != \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH && !$this->taxConfig->displayCartPricesBoth($store) && !$this->taxConfig->displayCartSubtotalBoth($store) && !$this->taxConfig->displayCartShippingBoth($store) && !$this->taxConfig->displaySalesPricesBoth($store) && !$this->taxConfig->displaySalesSubtotalBoth($store) && !$this->taxConfig->displaySalesShippingBoth($store);
 }
 /**
  * Shipping mode: 'both', 'including', 'excluding'
  *
  * @return string
  */
 public function getDisplayShippingMode()
 {
     if ($this->taxConfig->displayCartShippingBoth()) {
         return 'both';
     }
     if ($this->taxConfig->displayCartShippingExclTax()) {
         return 'excluding';
     }
     return 'including';
 }
Example #3
0
 /**
  * Check if we need display shipping include and exclude tax
  *
  * @return bool
  */
 public function displayBoth()
 {
     return $this->_taxConfig->displayCartShippingBoth($this->getStore());
 }