sync order

This commit is contained in:
Kai Ton 2024-05-18 01:21:16 +00:00
parent acf491d9e7
commit 6cab863d14
1 changed files with 6 additions and 3 deletions

View File

@ -37,9 +37,12 @@ class CheckOrderStatus implements ObserverInterface
{
$order = $observer->getEvent()->getOrder();
$listStateToSync = ['complete', 'processing', 'canceled'];
if ($order instanceof \Magento\Sales\Model\Order && in_array($order->getStatus(), $listStateToSync)) {
$sync = new \IpSupply\SyncOrder\Sync\Index;
$content = $sync->syncOrder($order);
$this->_saveLog($content);
}
}
}