init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Esun\CustomerCoupon\Model;
|
||||
|
||||
use Magento\Framework\App\Config\ScopeConfigInterface;
|
||||
use Magento\Store\Model\ScopeInterface;
|
||||
|
||||
class Config
|
||||
{
|
||||
private const XML_PATH_REGISTRATION_SUBSCRIPTION_RULE =
|
||||
'esun_customer_coupon/registration_subscription/rule_id';
|
||||
|
||||
public function __construct(private readonly ScopeConfigInterface $scopeConfig)
|
||||
{
|
||||
}
|
||||
|
||||
public function getRegistrationSubscriptionRuleId(?int $storeId = null): int
|
||||
{
|
||||
return (int)$this->scopeConfig->getValue(
|
||||
self::XML_PATH_REGISTRATION_SUBSCRIPTION_RULE,
|
||||
ScopeInterface::SCOPE_STORE,
|
||||
$storeId
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user