Files
module-integration/Order/Helper/Data.php
T
Jordan Price 189e2a67c5 Init Extension
Initialize the ActiveCampaign for Magento Extension
2021-08-11 11:17:41 -05:00

56 lines
1.3 KiB
PHP

<?php
namespace ActiveCampaign\Order\Helper;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;
class Data extends AbstractHelper
{
const ACTIVE_CAMPAIGN_ORDER_STATUS = "active_campaign/order_sync/order_sync_enable";
const ACTIVE_CAMPAIGN_ORDER_SYNC_NUM = "active_campaign/order_sync/order_sync_num";
/**
* @var \Magento\Framework\App\State *
*/
private $state;
/**
* Data constructor.
* @param Context $context
*/
public function __construct(
Context $context,
\Magento\Framework\App\State $state
) {
parent::__construct($context);
$this->state = $state;
}
/**
* @param null $scopeCode
* @return bool
*/
public function isOrderSyncEnabled($scopeCode = null)
{
return $this->scopeConfig->isSetFlag(
self::ACTIVE_CAMPAIGN_ORDER_STATUS,
ScopeInterface::SCOPE_STORES,
$scopeCode
);
}
/**
* @param null $scopeCode
* @return mixed
*/
public function getOrderSyncNum($scopeCode = null)
{
return $this->scopeConfig->getValue(
self::ACTIVE_CAMPAIGN_ORDER_SYNC_NUM,
ScopeInterface::SCOPE_STORES,
$scopeCode
);
}
}