diff --git a/app/code/IpSupply/SyncOrder/Observer/CheckOrderStatus.php b/app/code/IpSupply/SyncOrder/Observer/CheckOrderStatus.php index 2e73eb94..d7171ac6 100755 --- a/app/code/IpSupply/SyncOrder/Observer/CheckOrderStatus.php +++ b/app/code/IpSupply/SyncOrder/Observer/CheckOrderStatus.php @@ -37,9 +37,12 @@ class CheckOrderStatus implements ObserverInterface { $order = $observer->getEvent()->getOrder(); - $sync = new \IpSupply\SyncOrder\Sync\Index; - $content = $sync->syncOrder($order); - $this->_saveLog($content); + $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); + } } }