Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-instant-purchase
Model
Config.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\InstantPurchase\Model
;
7
8
use
Magento\Framework\App\Config\ScopeConfigInterface
;
9
use
Magento\Store\Model\ScopeInterface
;
10
use
Magento\Store\Model\StoreManagerInterface
;
11
15
class
Config
16
{
17
const
ACTIVE
=
'sales/instant_purchase/active'
;
18
const
BUTTON_TEXT
=
'sales/instant_purchase/button_text'
;
19
23
private
$scopeConfig;
24
29
public
function
__construct
(
30
ScopeConfigInterface
$scopeConfig
31
) {
32
$this->scopeConfig = $scopeConfig;
33
}
34
41
public
function
isModuleEnabled
(
int
$storeId
): bool
42
{
43
return
$this->isSetFlag(self::ACTIVE,
$storeId
);
44
}
45
52
public
function
getButtonText
(
int
$storeId
): string
53
{
54
return
$this->getValue(self::BUTTON_TEXT,
$storeId
);
55
}
56
64
private
function
getValue(
string
$path
,
int
$storeId
)
65
{
66
return
$this->scopeConfig->getValue(
67
$path
,
68
ScopeInterface::SCOPE_STORE
,
69
$storeId
70
);
71
}
72
80
private
function
isSetFlag(
string
$path
,
int
$storeId
): bool
81
{
82
return
$this->scopeConfig->isSetFlag(
83
$path
,
84
ScopeInterface::SCOPE_STORE
,
85
$storeId
86
);
87
}
88
}
Magento\Store\Model\ScopeInterface\SCOPE_STORE
const SCOPE_STORE
Definition:
ScopeInterface.php:21
$storeId
$storeId
Definition:
customer_review_with_rating.php:14
Magento\InstantPurchase\Model\Config\BUTTON_TEXT
const BUTTON_TEXT
Definition:
Config.php:18
Magento\InstantPurchase\Model\Config\isModuleEnabled
isModuleEnabled(int $storeId)
Definition:
Config.php:41
Magento\InstantPurchase\Model\Config\ACTIVE
const ACTIVE
Definition:
Config.php:17
Magento\InstantPurchase\Model\Config\getButtonText
getButtonText(int $storeId)
Definition:
Config.php:52
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\InstantPurchase\Model
Definition:
InstantPurchaseTest.php:6
Magento\Framework\App\ResourceConnection\Config
Definition:
Config.php:14
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15
Magento\InstantPurchase\Model\Config\__construct
__construct(ScopeConfigInterface $scopeConfig)
Definition:
Config.php:29
$path
$path
Definition:
import_with_filesystem_images.php:14