Files
jorgeeurekalabsandJor Ven 2cd367a7cc DEFECT-12960 (#45)
* fixed Allowed memory size issue and compatibility with php 7.4

* DEFECT-12960

Co-authored-by: Jor Ven <jorven@MacBook-Pro-de-Jor-2.local>
2022-11-01 13:18:27 -05:00

70 lines
1.7 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";
const ACTIVE_CAMPAIGN_ORDER_SYNC_REAL_TIME = "active_campaign/order_sync/order_sync_real_time";
/**
* @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 bool
*/
public function isOrderSyncInRealTime($scopeCode = null)
{
return $this->scopeConfig->isSetFlag(
self::ACTIVE_CAMPAIGN_ORDER_SYNC_REAL_TIME,
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
);
}
}