Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Config Class Reference

Public Member Functions

 __construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)
 
 priceIncludesTax ($store=null)
 
 setPriceIncludesTax ($value)
 
 applyTaxAfterDiscount ($store=null)
 
 getPriceDisplayType ($store=null)
 
 discountTax ($store=null)
 
 getCalculationSequence ($store=null)
 
 setNeedUseShippingExcludeTax ($flag)
 
 getNeedUseShippingExcludeTax ()
 
 getAlgorithm ($store=null)
 
 getShippingTaxClass ($store=null)
 
 getShippingPriceDisplayType ($store=null)
 
 shippingPriceIncludesTax ($store=null)
 
 setShippingPriceIncludeTax ($flag)
 
 displayCartPricesInclTax ($store=null)
 
 displayCartPricesExclTax ($store=null)
 
 displayCartPricesBoth ($store=null)
 
 displayCartSubtotalInclTax ($store=null)
 
 displayCartSubtotalExclTax ($store=null)
 
 displayCartSubtotalBoth ($store=null)
 
 displayCartShippingInclTax ($store=null)
 
 displayCartShippingExclTax ($store=null)
 
 displayCartShippingBoth ($store=null)
 
 displayCartDiscountInclTax ($store=null)
 
 displayCartDiscountExclTax ($store=null)
 
 displayCartDiscountBoth ($store=null)
 
 displayCartTaxWithGrandTotal ($store=null)
 
 displayCartFullSummary ($store=null)
 
 displayCartZeroTax ($store=null)
 
 displaySalesPricesInclTax ($store=null)
 
 displaySalesPricesExclTax ($store=null)
 
 displaySalesPricesBoth ($store=null)
 
 displaySalesSubtotalInclTax ($store=null)
 
 displaySalesSubtotalExclTax ($store=null)
 
 displaySalesSubtotalBoth ($store=null)
 
 displaySalesShippingInclTax ($store=null)
 
 displaySalesShippingExclTax ($store=null)
 
 displaySalesShippingBoth ($store=null)
 
 displaySalesDiscountInclTax ($store=null)
 
 displaySalesDiscountExclTax ($store=null)
 
 displaySalesDiscountBoth ($store=null)
 
 displaySalesTaxWithGrandTotal ($store=null)
 
 displaySalesFullSummary ($store=null)
 
 displaySalesZeroTax ($store=null)
 
 crossBorderTradeEnabled ($store=null)
 
 isWrongApplyDiscountSettingIgnored ($store=null)
 
 isWrongDisplaySettingsIgnored ($store=null)
 
 isWrongDiscountSettingsIgnored ($store=null)
 
 getInfoUrl ($store=null)
 
 needPriceConversion ($store=null)
 

Data Fields

const XML_PATH_TAX_NOTIFICATION_IGNORE_DISCOUNT = 'tax/notification/ignore_discount'
 
const XML_PATH_TAX_NOTIFICATION_IGNORE_PRICE_DISPLAY = 'tax/notification/ignore_price_display'
 
const XML_PATH_TAX_NOTIFICATION_IGNORE_APPLY_DISCOUNT = 'tax/notification/ignore_apply_discount'
 
const XML_PATH_TAX_NOTIFICATION_INFO_URL = 'tax/notification/info_url'
 
const CONFIG_XML_PATH_SHIPPING_TAX_CLASS = 'tax/classes/shipping_tax_class'
 
const CONFIG_XML_PATH_PRICE_INCLUDES_TAX = 'tax/calculation/price_includes_tax'
 
const CONFIG_XML_PATH_SHIPPING_INCLUDES_TAX = 'tax/calculation/shipping_includes_tax'
 
const CONFIG_XML_PATH_BASED_ON = 'tax/calculation/based_on'
 
const CONFIG_XML_PATH_APPLY_ON = 'tax/calculation/apply_tax_on'
 
const CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT = 'tax/calculation/apply_after_discount'
 
const CONFIG_XML_PATH_DISCOUNT_TAX = 'tax/calculation/discount_tax'
 
const XML_PATH_ALGORITHM = 'tax/calculation/algorithm'
 
const CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED = 'tax/calculation/cross_border_trade_enabled'
 
const CONFIG_XML_PATH_DEFAULT_COUNTRY = 'tax/defaults/country'
 
const CONFIG_XML_PATH_DEFAULT_REGION = 'tax/defaults/region'
 
const CONFIG_XML_PATH_DEFAULT_POSTCODE = 'tax/defaults/postcode'
 
const CONFIG_XML_PATH_PRICE_DISPLAY_TYPE = 'tax/display/type'
 
const CONFIG_XML_PATH_DISPLAY_SHIPPING = 'tax/display/shipping'
 
const XML_PATH_DISPLAY_CART_PRICE = 'tax/cart_display/price'
 
const XML_PATH_DISPLAY_CART_SUBTOTAL = 'tax/cart_display/subtotal'
 
const XML_PATH_DISPLAY_CART_SHIPPING = 'tax/cart_display/shipping'
 
const XML_PATH_DISPLAY_CART_DISCOUNT = 'tax/cart_display/discount'
 
const XML_PATH_DISPLAY_CART_GRANDTOTAL = 'tax/cart_display/grandtotal'
 
const XML_PATH_DISPLAY_CART_FULL_SUMMARY = 'tax/cart_display/full_summary'
 
const XML_PATH_DISPLAY_CART_ZERO_TAX = 'tax/cart_display/zero_tax'
 
const XML_PATH_DISPLAY_SALES_PRICE = 'tax/sales_display/price'
 
const XML_PATH_DISPLAY_SALES_SUBTOTAL = 'tax/sales_display/subtotal'
 
const XML_PATH_DISPLAY_SALES_SHIPPING = 'tax/sales_display/shipping'
 
const XML_PATH_DISPLAY_SALES_DISCOUNT = 'tax/sales_display/discount'
 
const XML_PATH_DISPLAY_SALES_GRANDTOTAL = 'tax/sales_display/grandtotal'
 
const XML_PATH_DISPLAY_SALES_FULL_SUMMARY = 'tax/sales_display/full_summary'
 
const XML_PATH_DISPLAY_SALES_ZERO_TAX = 'tax/sales_display/zero_tax'
 
const CALCULATION_STRING_SEPARATOR = '|'
 
const DISPLAY_TYPE_EXCLUDING_TAX = 1
 
const DISPLAY_TYPE_INCLUDING_TAX = 2
 
const DISPLAY_TYPE_BOTH = 3
 
const PRICE_CONVERSION_PLUS = 1
 
const PRICE_CONVERSION_MINUS = 2
 

Protected Attributes

 $_priceIncludesTax = null
 
 $_needUseShippingExcludeTax = false
 
 $_shippingPriceIncludeTax = null
 
 $_scopeConfig
 

Detailed Description

@SuppressWarnings(PHPMD.ExcessivePublicCount)

Definition at line 19 of file Config.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Config\ScopeConfigInterface  $scopeConfig)
Parameters
\Magento\Framework\App\Config\ScopeConfigInterface$scopeConfig

Definition at line 145 of file Config.php.

146  {
147  $this->_scopeConfig = $scopeConfig;
148  }

Member Function Documentation

◆ applyTaxAfterDiscount()

applyTaxAfterDiscount (   $store = null)

Check what taxes should be applied after discount

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 190 of file Config.php.

191  {
192  return (bool)$this->_scopeConfig->getValue(
193  self::CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT,
195  $store
196  );
197  }

◆ crossBorderTradeEnabled()

crossBorderTradeEnabled (   $store = null)

Return the config value for self::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 757 of file Config.php.

758  {
759  return (bool)$this->_scopeConfig->getValue(
760  self::CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED,
762  $store
763  );
764  }

◆ discountTax()

discountTax (   $store = null)

Get configuration setting "Apply Discount On Prices Including Tax" value

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 223 of file Config.php.

224  {
225  return (int)$this->_scopeConfig->getValue(
226  self::CONFIG_XML_PATH_DISCOUNT_TAX,
228  $store
229  ) == 1;
230  }

◆ displayCartDiscountBoth()

displayCartDiscountBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool
Deprecated:
100.1.3

Definition at line 505 of file Config.php.

506  {
507  return $this->_scopeConfig->getValue(
508  self::XML_PATH_DISPLAY_CART_DISCOUNT,
510  $store
512  }

◆ displayCartDiscountExclTax()

displayCartDiscountExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool
Deprecated:
100.1.3

Definition at line 491 of file Config.php.

492  {
493  return $this->_scopeConfig->getValue(
494  self::XML_PATH_DISPLAY_CART_DISCOUNT,
496  $store
498  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displayCartDiscountInclTax()

displayCartDiscountInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool
Deprecated:
100.1.3

Definition at line 477 of file Config.php.

478  {
479  return $this->_scopeConfig->getValue(
480  self::XML_PATH_DISPLAY_CART_DISCOUNT,
482  $store
484  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displayCartFullSummary()

displayCartFullSummary (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 531 of file Config.php.

532  {
533  return (bool)$this->_scopeConfig->getValue(
534  self::XML_PATH_DISPLAY_CART_FULL_SUMMARY,
536  $store
537  );
538  }

◆ displayCartPricesBoth()

displayCartPricesBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 385 of file Config.php.

386  {
387  return $this->_scopeConfig->getValue(
388  self::XML_PATH_DISPLAY_CART_PRICE,
390  $store
392  }

◆ displayCartPricesExclTax()

displayCartPricesExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 372 of file Config.php.

373  {
374  return $this->_scopeConfig->getValue(
375  self::XML_PATH_DISPLAY_CART_PRICE,
377  $store
379  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displayCartPricesInclTax()

displayCartPricesInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 359 of file Config.php.

360  {
361  return $this->_scopeConfig->getValue(
362  self::XML_PATH_DISPLAY_CART_PRICE,
364  $store
366  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displayCartShippingBoth()

displayCartShippingBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 463 of file Config.php.

464  {
465  return $this->_scopeConfig->getValue(
466  self::XML_PATH_DISPLAY_CART_SHIPPING,
468  $store
470  }

◆ displayCartShippingExclTax()

displayCartShippingExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 450 of file Config.php.

451  {
452  return $this->_scopeConfig->getValue(
453  self::XML_PATH_DISPLAY_CART_SHIPPING,
455  $store
457  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displayCartShippingInclTax()

displayCartShippingInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 437 of file Config.php.

438  {
439  return $this->_scopeConfig->getValue(
440  self::XML_PATH_DISPLAY_CART_SHIPPING,
442  $store
444  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displayCartSubtotalBoth()

displayCartSubtotalBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 424 of file Config.php.

425  {
426  return $this->_scopeConfig->getValue(
427  self::XML_PATH_DISPLAY_CART_SUBTOTAL,
429  $store
431  }

◆ displayCartSubtotalExclTax()

displayCartSubtotalExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 411 of file Config.php.

412  {
413  return $this->_scopeConfig->getValue(
414  self::XML_PATH_DISPLAY_CART_SUBTOTAL,
416  $store
418  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displayCartSubtotalInclTax()

displayCartSubtotalInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 398 of file Config.php.

399  {
400  return $this->_scopeConfig->getValue(
401  self::XML_PATH_DISPLAY_CART_SUBTOTAL,
403  $store
405  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displayCartTaxWithGrandTotal()

displayCartTaxWithGrandTotal (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 518 of file Config.php.

519  {
520  return (bool)$this->_scopeConfig->getValue(
521  self::XML_PATH_DISPLAY_CART_GRANDTOTAL,
523  $store
524  );
525  }

◆ displayCartZeroTax()

displayCartZeroTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 544 of file Config.php.

545  {
546  return (bool)$this->_scopeConfig->getValue(
547  self::XML_PATH_DISPLAY_CART_ZERO_TAX,
549  $store
550  );
551  }

◆ displaySalesDiscountBoth()

displaySalesDiscountBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool
Deprecated:
100.1.3

Definition at line 703 of file Config.php.

704  {
705  return $this->_scopeConfig->getValue(
706  self::XML_PATH_DISPLAY_SALES_DISCOUNT,
708  $store
710  }

◆ displaySalesDiscountExclTax()

displaySalesDiscountExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool
Deprecated:
100.1.3

Definition at line 689 of file Config.php.

690  {
691  return $this->_scopeConfig->getValue(
692  self::XML_PATH_DISPLAY_SALES_DISCOUNT,
694  $store
696  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displaySalesDiscountInclTax()

displaySalesDiscountInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool
Deprecated:
100.1.3

Definition at line 675 of file Config.php.

676  {
677  return $this->_scopeConfig->getValue(
678  self::XML_PATH_DISPLAY_SALES_DISCOUNT,
680  $store
682  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displaySalesFullSummary()

displaySalesFullSummary (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 729 of file Config.php.

730  {
731  return (bool)$this->_scopeConfig->getValue(
732  self::XML_PATH_DISPLAY_SALES_FULL_SUMMARY,
734  $store
735  );
736  }

◆ displaySalesPricesBoth()

displaySalesPricesBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 583 of file Config.php.

584  {
585  return $this->_scopeConfig->getValue(
586  self::XML_PATH_DISPLAY_SALES_PRICE,
588  $store
590  }

◆ displaySalesPricesExclTax()

displaySalesPricesExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 570 of file Config.php.

571  {
572  return $this->_scopeConfig->getValue(
573  self::XML_PATH_DISPLAY_SALES_PRICE,
575  $store
577  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displaySalesPricesInclTax()

displaySalesPricesInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 557 of file Config.php.

558  {
559  return $this->_scopeConfig->getValue(
560  self::XML_PATH_DISPLAY_SALES_PRICE,
562  $store
564  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displaySalesShippingBoth()

displaySalesShippingBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 661 of file Config.php.

662  {
663  return $this->_scopeConfig->getValue(
664  self::XML_PATH_DISPLAY_SALES_SHIPPING,
666  $store
668  }

◆ displaySalesShippingExclTax()

displaySalesShippingExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 648 of file Config.php.

649  {
650  return $this->_scopeConfig->getValue(
651  self::XML_PATH_DISPLAY_SALES_SHIPPING,
653  $store
655  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displaySalesShippingInclTax()

displaySalesShippingInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 635 of file Config.php.

636  {
637  return $this->_scopeConfig->getValue(
638  self::XML_PATH_DISPLAY_SALES_SHIPPING,
640  $store
642  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displaySalesSubtotalBoth()

displaySalesSubtotalBoth (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 622 of file Config.php.

623  {
624  return $this->_scopeConfig->getValue(
625  self::XML_PATH_DISPLAY_SALES_SUBTOTAL,
627  $store
629  }

◆ displaySalesSubtotalExclTax()

displaySalesSubtotalExclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 609 of file Config.php.

610  {
611  return $this->_scopeConfig->getValue(
612  self::XML_PATH_DISPLAY_SALES_SUBTOTAL,
614  $store
616  }
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102

◆ displaySalesSubtotalInclTax()

displaySalesSubtotalInclTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 596 of file Config.php.

597  {
598  return $this->_scopeConfig->getValue(
599  self::XML_PATH_DISPLAY_SALES_SUBTOTAL,
601  $store
603  }
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104

◆ displaySalesTaxWithGrandTotal()

displaySalesTaxWithGrandTotal (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 716 of file Config.php.

717  {
718  return (bool)$this->_scopeConfig->getValue(
719  self::XML_PATH_DISPLAY_SALES_GRANDTOTAL,
721  $store
722  );
723  }

◆ displaySalesZeroTax()

displaySalesZeroTax (   $store = null)
Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 742 of file Config.php.

743  {
744  return (bool)$this->_scopeConfig->getValue(
745  self::XML_PATH_DISPLAY_SALES_ZERO_TAX,
747  $store
748  );
749  }

◆ getAlgorithm()

getAlgorithm (   $store = null)

Get defined tax calculation algorithm

Parameters
null | string | bool | int | Store$store
Returns
string

Definition at line 286 of file Config.php.

287  {
288  return $this->_scopeConfig->getValue(
289  self::XML_PATH_ALGORITHM,
291  $store
292  );
293  }

◆ getCalculationSequence()

getCalculationSequence (   $store = null)

Get taxes/discounts calculation sequence. This sequence depends on "Apply Customer Tax" and "Apply Discount On Prices" configuration options.

Parameters
null | int | string | Store$store
Returns
string

Definition at line 239 of file Config.php.

240  {
241  if ($this->applyTaxAfterDiscount($store)) {
242  if ($this->discountTax($store)) {
244  } else {
246  }
247  } else {
248  if ($this->discountTax($store)) {
250  } else {
252  }
253  }
254  return $seq;
255  }
applyTaxAfterDiscount($store=null)
Definition: Config.php:190
discountTax($store=null)
Definition: Config.php:223

◆ getInfoUrl()

getInfoUrl (   $store = null)

Return the notification info url

Parameters
null | string | bool | int | Store$store
Returns
string

Definition at line 821 of file Config.php.

822  {
823  return (string)$this->_scopeConfig->getValue(
824  self::XML_PATH_TAX_NOTIFICATION_INFO_URL,
826  $store
827  );
828  }

◆ getNeedUseShippingExcludeTax()

getNeedUseShippingExcludeTax ( )

Get flag what we need use shipping price exclude tax

Returns
bool $flag @SuppressWarnings(PHPMD.BooleanGetMethodName)

Definition at line 275 of file Config.php.

276  {
278  }

◆ getPriceDisplayType()

getPriceDisplayType (   $store = null)

Get product price display type 1 - Excluding tax 2 - Including tax 3 - Both

Parameters
null | string | bool | int | Store$store
Returns
int

Definition at line 208 of file Config.php.

209  {
210  return (int)$this->_scopeConfig->getValue(
211  self::CONFIG_XML_PATH_PRICE_DISPLAY_TYPE,
213  $store
214  );
215  }

◆ getShippingPriceDisplayType()

getShippingPriceDisplayType (   $store = null)

Get shipping methods prices display type

Parameters
null | string | bool | int | Store$store
Returns
int

Definition at line 316 of file Config.php.

317  {
318  return (int)$this->_scopeConfig->getValue(
319  self::CONFIG_XML_PATH_DISPLAY_SHIPPING,
321  $store
322  );
323  }

◆ getShippingTaxClass()

getShippingTaxClass (   $store = null)

Get tax class id specified for shipping tax estimation

Parameters
null | string | bool | int | Store$store
Returns
int

Definition at line 301 of file Config.php.

302  {
303  return (int)$this->_scopeConfig->getValue(
304  self::CONFIG_XML_PATH_SHIPPING_TAX_CLASS,
306  $store
307  );
308  }

◆ isWrongApplyDiscountSettingIgnored()

isWrongApplyDiscountSettingIgnored (   $store = null)

Check if admin notification related to misconfiguration of "Apply Discount On Prices" should be ignored.

Warning is displayed in case when "Catalog Prices" = "Excluding Tax" AND "Apply Discount On Prices" = "Including Tax" AND "Apply Customer Tax" = "After Discount"

Parameters
null | string | Store$store
Returns
bool

Definition at line 776 of file Config.php.

777  {
778  return (bool)$this->_scopeConfig->getValue(
779  self::XML_PATH_TAX_NOTIFICATION_IGNORE_APPLY_DISCOUNT,
781  $store
782  );
783  }

◆ isWrongDiscountSettingsIgnored()

isWrongDiscountSettingsIgnored (   $store = null)

Check if do not show notification about wrong discount settings

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 806 of file Config.php.

807  {
808  return (bool)$this->_scopeConfig->getValue(
809  self::XML_PATH_TAX_NOTIFICATION_IGNORE_DISCOUNT,
811  $store
812  );
813  }

◆ isWrongDisplaySettingsIgnored()

isWrongDisplaySettingsIgnored (   $store = null)

Check if do not show notification about wrong display settings

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 791 of file Config.php.

792  {
793  return (bool)$this->_scopeConfig->getValue(
794  self::XML_PATH_TAX_NOTIFICATION_IGNORE_PRICE_DISPLAY,
796  $store
797  );
798  }

◆ needPriceConversion()

needPriceConversion (   $store = null)

Check if necessary do product price conversion If it necessary will be returned conversion type (minus or plus)

Parameters
null | int | string | Store$store
Returns
bool|int @SuppressWarnings(PHPMD.CyclomaticComplexity)

Definition at line 838 of file Config.php.

839  {
840  $res = 0;
841  $priceIncludesTax = $this->priceIncludesTax($store) || $this->getNeedUseShippingExcludeTax();
842  if ($priceIncludesTax) {
843  switch ($this->getPriceDisplayType($store)) {
848  $res = false;
849  break;
850  default:
851  break;
852  }
853  } else {
854  switch ($this->getPriceDisplayType($store)) {
859  $res = false;
860  break;
861  default:
862  break;
863  }
864  }
865 
866  if ($res === false) {
867  $res = $this->displayCartPricesBoth();
868  }
869  return $res;
870  }
displayCartPricesBoth($store=null)
Definition: Config.php:385
priceIncludesTax($store=null)
Definition: Config.php:156
const DISPLAY_TYPE_EXCLUDING_TAX
Definition: Config.php:102
const DISPLAY_TYPE_INCLUDING_TAX
Definition: Config.php:104
getPriceDisplayType($store=null)
Definition: Config.php:208

◆ priceIncludesTax()

priceIncludesTax (   $store = null)

Check if prices of product in catalog include tax

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 156 of file Config.php.

157  {
158  if (null !== $this->_priceIncludesTax) {
160  }
161  return (bool)$this->_scopeConfig->getValue(
162  self::CONFIG_XML_PATH_PRICE_INCLUDES_TAX,
164  $store
165  );
166  }

◆ setNeedUseShippingExcludeTax()

setNeedUseShippingExcludeTax (   $flag)

Specify flag what we need use shipping price exclude tax

Parameters
bool$flag
Returns
\Magento\Tax\Model\Config

Definition at line 263 of file Config.php.

264  {
265  $this->_needUseShippingExcludeTax = $flag;
266  return $this;
267  }

◆ setPriceIncludesTax()

setPriceIncludesTax (   $value)

Override "price includes tax" variable regardless of system configuration of any store

Parameters
bool | null$value
Returns
$this

Definition at line 174 of file Config.php.

175  {
176  if (null === $value) {
177  $this->_priceIncludesTax = null;
178  } else {
179  $this->_priceIncludesTax = (bool)$value;
180  }
181  return $this;
182  }
$value
Definition: gender.phtml:16

◆ setShippingPriceIncludeTax()

setShippingPriceIncludeTax (   $flag)

Declare shipping prices type

Parameters
bool$flag
Returns
$this

Definition at line 349 of file Config.php.

350  {
351  $this->_shippingPriceIncludeTax = $flag;
352  return $this;
353  }

◆ shippingPriceIncludesTax()

shippingPriceIncludesTax (   $store = null)

Check if shipping prices include tax

Parameters
null | string | bool | int | Store$store
Returns
bool

Definition at line 331 of file Config.php.

332  {
333  if ($this->_shippingPriceIncludeTax === null) {
334  $this->_shippingPriceIncludeTax = (bool)$this->_scopeConfig->getValue(
335  self::CONFIG_XML_PATH_SHIPPING_INCLUDES_TAX,
337  $store
338  );
339  }
341  }

Field Documentation

◆ $_needUseShippingExcludeTax

$_needUseShippingExcludeTax = false
protected

Definition at line 128 of file Config.php.

◆ $_priceIncludesTax

$_priceIncludesTax = null
protected

Definition at line 121 of file Config.php.

◆ $_scopeConfig

$_scopeConfig
protected

Definition at line 140 of file Config.php.

◆ $_shippingPriceIncludeTax

$_shippingPriceIncludeTax = null
protected

Definition at line 133 of file Config.php.

◆ CALCULATION_STRING_SEPARATOR

const CALCULATION_STRING_SEPARATOR = '|'

Definition at line 100 of file Config.php.

◆ CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT

const CONFIG_XML_PATH_APPLY_AFTER_DISCOUNT = 'tax/calculation/apply_after_discount'

Definition at line 42 of file Config.php.

◆ CONFIG_XML_PATH_APPLY_ON

const CONFIG_XML_PATH_APPLY_ON = 'tax/calculation/apply_tax_on'

Definition at line 40 of file Config.php.

◆ CONFIG_XML_PATH_BASED_ON

const CONFIG_XML_PATH_BASED_ON = 'tax/calculation/based_on'

Definition at line 38 of file Config.php.

◆ CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED

const CONFIG_XML_PATH_CROSS_BORDER_TRADE_ENABLED = 'tax/calculation/cross_border_trade_enabled'

Definition at line 48 of file Config.php.

◆ CONFIG_XML_PATH_DEFAULT_COUNTRY

const CONFIG_XML_PATH_DEFAULT_COUNTRY = 'tax/defaults/country'

Definition at line 51 of file Config.php.

◆ CONFIG_XML_PATH_DEFAULT_POSTCODE

const CONFIG_XML_PATH_DEFAULT_POSTCODE = 'tax/defaults/postcode'

Definition at line 55 of file Config.php.

◆ CONFIG_XML_PATH_DEFAULT_REGION

const CONFIG_XML_PATH_DEFAULT_REGION = 'tax/defaults/region'

Definition at line 53 of file Config.php.

◆ CONFIG_XML_PATH_DISCOUNT_TAX

const CONFIG_XML_PATH_DISCOUNT_TAX = 'tax/calculation/discount_tax'

Definition at line 44 of file Config.php.

◆ CONFIG_XML_PATH_DISPLAY_SHIPPING

const CONFIG_XML_PATH_DISPLAY_SHIPPING = 'tax/display/shipping'

Definition at line 62 of file Config.php.

◆ CONFIG_XML_PATH_PRICE_DISPLAY_TYPE

const CONFIG_XML_PATH_PRICE_DISPLAY_TYPE = 'tax/display/type'

Prices display settings

Definition at line 60 of file Config.php.

◆ CONFIG_XML_PATH_PRICE_INCLUDES_TAX

const CONFIG_XML_PATH_PRICE_INCLUDES_TAX = 'tax/calculation/price_includes_tax'

Definition at line 34 of file Config.php.

◆ CONFIG_XML_PATH_SHIPPING_INCLUDES_TAX

const CONFIG_XML_PATH_SHIPPING_INCLUDES_TAX = 'tax/calculation/shipping_includes_tax'

Definition at line 36 of file Config.php.

◆ CONFIG_XML_PATH_SHIPPING_TAX_CLASS

const CONFIG_XML_PATH_SHIPPING_TAX_CLASS = 'tax/classes/shipping_tax_class'

Definition at line 31 of file Config.php.

◆ DISPLAY_TYPE_BOTH

const DISPLAY_TYPE_BOTH = 3

Definition at line 106 of file Config.php.

◆ DISPLAY_TYPE_EXCLUDING_TAX

const DISPLAY_TYPE_EXCLUDING_TAX = 1

Definition at line 102 of file Config.php.

◆ DISPLAY_TYPE_INCLUDING_TAX

const DISPLAY_TYPE_INCLUDING_TAX = 2

Definition at line 104 of file Config.php.

◆ PRICE_CONVERSION_MINUS

const PRICE_CONVERSION_MINUS = 2

Price conversion constant for negative

Definition at line 116 of file Config.php.

◆ PRICE_CONVERSION_PLUS

const PRICE_CONVERSION_PLUS = 1

Price conversion constant for positive

Definition at line 111 of file Config.php.

◆ XML_PATH_ALGORITHM

const XML_PATH_ALGORITHM = 'tax/calculation/algorithm'

Definition at line 46 of file Config.php.

◆ XML_PATH_DISPLAY_CART_DISCOUNT

const XML_PATH_DISPLAY_CART_DISCOUNT = 'tax/cart_display/discount'
Deprecated:

Definition at line 74 of file Config.php.

◆ XML_PATH_DISPLAY_CART_FULL_SUMMARY

const XML_PATH_DISPLAY_CART_FULL_SUMMARY = 'tax/cart_display/full_summary'

Definition at line 78 of file Config.php.

◆ XML_PATH_DISPLAY_CART_GRANDTOTAL

const XML_PATH_DISPLAY_CART_GRANDTOTAL = 'tax/cart_display/grandtotal'

Definition at line 76 of file Config.php.

◆ XML_PATH_DISPLAY_CART_PRICE

const XML_PATH_DISPLAY_CART_PRICE = 'tax/cart_display/price'

Shopping cart display settings

Definition at line 67 of file Config.php.

◆ XML_PATH_DISPLAY_CART_SHIPPING

const XML_PATH_DISPLAY_CART_SHIPPING = 'tax/cart_display/shipping'

Definition at line 71 of file Config.php.

◆ XML_PATH_DISPLAY_CART_SUBTOTAL

const XML_PATH_DISPLAY_CART_SUBTOTAL = 'tax/cart_display/subtotal'

Definition at line 69 of file Config.php.

◆ XML_PATH_DISPLAY_CART_ZERO_TAX

const XML_PATH_DISPLAY_CART_ZERO_TAX = 'tax/cart_display/zero_tax'

Definition at line 80 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_DISCOUNT

const XML_PATH_DISPLAY_SALES_DISCOUNT = 'tax/sales_display/discount'
Deprecated:

Definition at line 92 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_FULL_SUMMARY

const XML_PATH_DISPLAY_SALES_FULL_SUMMARY = 'tax/sales_display/full_summary'

Definition at line 96 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_GRANDTOTAL

const XML_PATH_DISPLAY_SALES_GRANDTOTAL = 'tax/sales_display/grandtotal'

Definition at line 94 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_PRICE

const XML_PATH_DISPLAY_SALES_PRICE = 'tax/sales_display/price'

Shopping cart display settings

Definition at line 85 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_SHIPPING

const XML_PATH_DISPLAY_SALES_SHIPPING = 'tax/sales_display/shipping'

Definition at line 89 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_SUBTOTAL

const XML_PATH_DISPLAY_SALES_SUBTOTAL = 'tax/sales_display/subtotal'

Definition at line 87 of file Config.php.

◆ XML_PATH_DISPLAY_SALES_ZERO_TAX

const XML_PATH_DISPLAY_SALES_ZERO_TAX = 'tax/sales_display/zero_tax'

Definition at line 98 of file Config.php.

◆ XML_PATH_TAX_NOTIFICATION_IGNORE_APPLY_DISCOUNT

const XML_PATH_TAX_NOTIFICATION_IGNORE_APPLY_DISCOUNT = 'tax/notification/ignore_apply_discount'

Definition at line 26 of file Config.php.

◆ XML_PATH_TAX_NOTIFICATION_IGNORE_DISCOUNT

const XML_PATH_TAX_NOTIFICATION_IGNORE_DISCOUNT = 'tax/notification/ignore_discount'

Definition at line 22 of file Config.php.

◆ XML_PATH_TAX_NOTIFICATION_IGNORE_PRICE_DISPLAY

const XML_PATH_TAX_NOTIFICATION_IGNORE_PRICE_DISPLAY = 'tax/notification/ignore_price_display'

Definition at line 24 of file Config.php.

◆ XML_PATH_TAX_NOTIFICATION_INFO_URL

const XML_PATH_TAX_NOTIFICATION_INFO_URL = 'tax/notification/info_url'

Definition at line 28 of file Config.php.


The documentation for this class was generated from the following file: