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 (ScopeConfigInterface $scopeConfig, StoreManagerInterface $storeManager, Escaper $escaper)
 
 setStoreId ($store)
 
 isEnabled ()
 
 getDisplayActualPriceType ()
 
 getExplanationMessage ()
 
 getExplanationMessageWhatsThis ()
 

Data Fields

const XML_PATH_MSRP_ENABLED = 'sales/msrp/enabled'
 
const XML_PATH_MSRP_DISPLAY_ACTUAL_PRICE_TYPE = 'sales/msrp/display_price_type'
 
const XML_PATH_MSRP_EXPLANATION_MESSAGE = 'sales/msrp/explanation_message'
 
const XML_PATH_MSRP_EXPLANATION_MESSAGE_WHATS_THIS = 'sales/msrp/explanation_message_whats_this'
 

Protected Attributes

 $scopeConfig
 
 $storeManager
 
 $escaper
 
 $storeId
 

Detailed Description

Definition at line 13 of file Config.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ScopeConfigInterface  $scopeConfig,
StoreManagerInterface  $storeManager,
Escaper  $escaper 
)
Parameters
ScopeConfigInterface$scopeConfig
StoreManagerInterface$storeManager
Escaper$escaper

Definition at line 47 of file Config.php.

51  {
52  $this->scopeConfig = $scopeConfig;
53  $this->storeManager = $storeManager;
54  $this->escaper = $escaper;
55  }

Member Function Documentation

◆ getDisplayActualPriceType()

getDisplayActualPriceType ( )

Return Msrp display actual type

Returns
null|string

Definition at line 89 of file Config.php.

90  {
91  return $this->scopeConfig->getValue(
92  self::XML_PATH_MSRP_DISPLAY_ACTUAL_PRICE_TYPE,
94  $this->storeId
95  );
96  }

◆ getExplanationMessage()

getExplanationMessage ( )

Return Msrp explanation message

Returns
string

Definition at line 103 of file Config.php.

104  {
105  return $this->escaper->escapeHtml(
106  $this->scopeConfig->getValue(
107  self::XML_PATH_MSRP_EXPLANATION_MESSAGE,
109  $this->storeId
110  ),
111  ['b', 'br', 'strong', 'i', 'u', 'p', 'span']
112  );
113  }

◆ getExplanationMessageWhatsThis()

getExplanationMessageWhatsThis ( )

Return Msrp explanation message for "Whats This" window

Returns
string

Definition at line 120 of file Config.php.

121  {
122  return $this->escaper->escapeHtml(
123  $this->scopeConfig->getValue(
124  self::XML_PATH_MSRP_EXPLANATION_MESSAGE_WHATS_THIS,
126  $this->storeId
127  ),
128  ['b', 'br', 'strong', 'i', 'u', 'p', 'span']
129  );
130  }

◆ isEnabled()

isEnabled ( )

Check if Minimum Advertised Price is enabled

Returns
bool @api

Definition at line 75 of file Config.php.

76  {
77  return (bool)$this->scopeConfig->getValue(
78  self::XML_PATH_MSRP_ENABLED,
80  $this->storeId
81  );
82  }

◆ setStoreId()

setStoreId (   $store)

Set a specified store ID value

Parameters
int$store
Returns
$this

Definition at line 63 of file Config.php.

64  {
65  $this->storeId = $store;
66  return $this;
67  }

Field Documentation

◆ $escaper

$escaper
protected

Definition at line 35 of file Config.php.

◆ $scopeConfig

$scopeConfig
protected

#- #-

Definition at line 25 of file Config.php.

◆ $storeId

$storeId
protected

Definition at line 40 of file Config.php.

◆ $storeManager

$storeManager
protected

Definition at line 30 of file Config.php.

◆ XML_PATH_MSRP_DISPLAY_ACTUAL_PRICE_TYPE

const XML_PATH_MSRP_DISPLAY_ACTUAL_PRICE_TYPE = 'sales/msrp/display_price_type'

Definition at line 19 of file Config.php.

◆ XML_PATH_MSRP_ENABLED

const XML_PATH_MSRP_ENABLED = 'sales/msrp/enabled'

#+ Minimum advertise price constants

Definition at line 18 of file Config.php.

◆ XML_PATH_MSRP_EXPLANATION_MESSAGE

const XML_PATH_MSRP_EXPLANATION_MESSAGE = 'sales/msrp/explanation_message'

Definition at line 20 of file Config.php.

◆ XML_PATH_MSRP_EXPLANATION_MESSAGE_WHATS_THIS

const XML_PATH_MSRP_EXPLANATION_MESSAGE_WHATS_THIS = 'sales/msrp/explanation_message_whats_this'

Definition at line 21 of file Config.php.


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