ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Lts\Checkout\Observer;
|
||||
|
||||
use Lts\Catalog\Helper\ShowProductOrNot;
|
||||
use Magento\Framework\Event\Observer;
|
||||
|
||||
class CheckCustomer implements \Magento\Framework\Event\ObserverInterface
|
||||
{
|
||||
private ShowProductOrNot $showProductOrNot;
|
||||
|
||||
public function __construct(
|
||||
ShowProductOrNot $showProductOrNot
|
||||
)
|
||||
{
|
||||
$this->showProductOrNot = $showProductOrNot;
|
||||
}
|
||||
|
||||
public function execute(Observer $observer)
|
||||
{
|
||||
if (!$this->showProductOrNot->checkByNetsuiteStatus()) {
|
||||
throw new \Magento\Framework\Exception\LocalizedException(__('You cannot purchase right now.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user