ltsecurityinc安防产品在线商城代码

This commit is contained in:
2026-09-14 17:47:10 +08:00
parent 57d8444c15
commit 6a3c9c5bd8
14539 changed files with 1775310 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<?php
namespace JR\NetSuite\Plugin;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;
class EmailNotification
{
/**
* @var ScopeConfigInterface
*/
protected $_scopeConfig;
public function __construct(
ScopeConfigInterface $scopeConfig
) {
$this->_scopeConfig = $scopeConfig;
}
public function aroundNewAccount(
\Magento\Customer\Model\EmailNotification $subject,
\Closure $proceed,
$customer,
$type = \Magento\Customer\Model\EmailNotification::NEW_ACCOUNT_EMAIL_REGISTERED,
$backUrl = '',
$storeId = null,
$sendemailStoreId = null
) {
$disabled = $customer->getCustomAttribute('netsuite_id');
if ($disabled) {
return;
}
$result = $proceed($customer, $type, $backUrl, $storeId, $sendemailStoreId);
return $result;
}
}
+46
View File
@@ -0,0 +1,46 @@
<?php
namespace JR\NetSuite\Plugin;
class SendEmailWhenRmaChanged
{
/**
* @var \JR\NetSuite\Model\ResourceModel\RmaQueue\CollectionFactory
*/
private $rmaQueueCollectionFactory;
/**
* @var \Mirasvit\Rma\Api\Service\Rma\RmaManagementInterface
*/
private $rmaManagement;
public function __construct(
\JR\NetSuite\Model\ResourceModel\RmaQueue\CollectionFactory $rmaQueueCollectionFactory,
\Mirasvit\Rma\Api\Service\Rma\RmaManagementInterface $rmaManagement
)
{
$this->rmaQueueCollectionFactory = $rmaQueueCollectionFactory;
$this->rmaManagement = $rmaManagement;
}
public function aroundOnRmaStatusChange(
\Mirasvit\Rma\Helper\Rma\Event $subject,
callable $proceed,
$rma
) {
// if RMA just created, do nothing
$rmaQueueCollection = $this->rmaQueueCollectionFactory->create();
$rmaQueueCollection->addFieldToFilter('status', 'processing');
$order = $this->rmaManagement->getOrder($rma);
foreach ($rmaQueueCollection as $rmaQueue) {
if ($rmaQueue->getOrderIncrementId() == $order->getRealorderId()) {
return;
}
}
$result = $proceed($rma);
return $result;
}
}