Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
WeeeConfigProvider Class Reference
Inheritance diagram for WeeeConfigProvider:
ConfigProviderInterface

Public Member Functions

 __construct (WeeeHelper $weeeHelper, StoreManagerInterface $storeManager, Config $weeeConfig)
 
 getConfig ()
 
 iDisplayPriceWithWeeeDetails ()
 
 isDisplayFinalPrice ()
 
 isWeeeEnabled ()
 
 getIncludeWeeeFlag ()
 
 isIncludedInSubtotal ()
 

Protected Attributes

 $weeeHelper
 
 $storeManager
 
 $weeeConfig
 

Detailed Description

Definition at line 13 of file WeeeConfigProvider.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( WeeeHelper  $weeeHelper,
StoreManagerInterface  $storeManager,
Config  $weeeConfig 
)
Parameters
WeeeHelper$weeeHelper
StoreManagerInterface$storeManager
Config$weeeConfig

Definition at line 35 of file WeeeConfigProvider.php.

Member Function Documentation

◆ getConfig()

getConfig ( )

{Retrieve assoc array of checkout configuration

Returns
array
}

Implements ConfigProviderInterface.

Definition at line 48 of file WeeeConfigProvider.php.

49  {
50  return [
51  'isDisplayPriceWithWeeeDetails' => $this->iDisplayPriceWithWeeeDetails(),
52  'isDisplayFinalPrice' => $this->isDisplayFinalPrice(),
53  'isWeeeEnabled' => $this->isWeeeEnabled(),
54  'isIncludedInSubtotal' => $this->isIncludedInSubtotal(),
55  'getIncludeWeeeFlag' => $this->getIncludeWeeeFlag()
56  ];
57  }

◆ getIncludeWeeeFlag()

getIncludeWeeeFlag ( )

Return the flag whether to include weee in the price

Returns
bool|int

Definition at line 124 of file WeeeConfigProvider.php.

125  {
126  $includeWeee = $this->weeeHelper->typeOfDisplay(
127  [WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_INCL],
128  'cart',
129  $this->getStoreId()
130  );
131  return $includeWeee;
132  }

◆ iDisplayPriceWithWeeeDetails()

iDisplayPriceWithWeeeDetails ( )

Whether to display weee details together with price

Returns
bool

Definition at line 72 of file WeeeConfigProvider.php.

73  {
74  if (!$this->weeeHelper->isEnabled($this->getStoreId())) {
75  return false;
76  }
77 
78  $displayWeeeDetails = $this->weeeHelper->typeOfDisplay(
79  [WeeeDisplayConfig::DISPLAY_INCL_DESCR, WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL],
80  'cart',
81  $this->storeManager->getStore()->getId()
82  );
83  if (!$displayWeeeDetails) {
84  return false;
85  }
86  return true;
87  }

◆ isDisplayFinalPrice()

isDisplayFinalPrice ( )

Whether to display final price that include Weee amounts

Returns
bool

Definition at line 94 of file WeeeConfigProvider.php.

95  {
96  $flag = $this->weeeHelper->typeOfDisplay(
97  WeeeDisplayConfig::DISPLAY_EXCL_DESCR_INCL,
98  'cart',
99  $this->storeManager->getStore()->getId()
100  );
101 
102  if (!$flag) {
103  return false;
104  }
105 
106  return true;
107  }

◆ isIncludedInSubtotal()

isIncludedInSubtotal ( )

Display FPT row in subtotal or not

Returns
bool

Definition at line 139 of file WeeeConfigProvider.php.

140  {
141  return $this->weeeConfig->isEnabled() && $this->weeeConfig->includeInSubtotal();
142  }

◆ isWeeeEnabled()

isWeeeEnabled ( )

Check if fixed taxes are used in system

Returns
bool

Definition at line 114 of file WeeeConfigProvider.php.

115  {
116  return $this->weeeHelper->isEnabled($this->storeManager->getStore()->getId());
117  }

Field Documentation

◆ $storeManager

$storeManager
protected

Definition at line 23 of file WeeeConfigProvider.php.

◆ $weeeConfig

$weeeConfig
protected

Definition at line 28 of file WeeeConfigProvider.php.

◆ $weeeHelper

$weeeHelper
protected

Definition at line 18 of file WeeeConfigProvider.php.


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