Compare commits

..

No commits in common. "6cab863d14c1fa2ce8583cf1093fc36353b017b9" and "24a6df5a3b30992383a75f1cb73f56f1d0f6092c" have entirely different histories.

1 changed files with 4 additions and 6 deletions

View File

@ -30,6 +30,7 @@ class CheckOrderStatus implements ObserverInterface
$currentContent .= date("Y-m-d H:i:s") . ':'; $currentContent .= date("Y-m-d H:i:s") . ':';
$currentContent .= $content; $currentContent .= $content;
$currentContent .= "\n"; $currentContent .= "\n";
$currentContent = str_replace(array("\r", "\n"), '', 500);
file_put_contents($file, $currentContent); file_put_contents($file, $currentContent);
} }
@ -37,12 +38,9 @@ class CheckOrderStatus implements ObserverInterface
{ {
$order = $observer->getEvent()->getOrder(); $order = $observer->getEvent()->getOrder();
$listStateToSync = ['complete', 'processing', 'canceled']; $sync = new \IpSupply\SyncOrder\Sync\Index;
if ($order instanceof \Magento\Sales\Model\Order && in_array($order->getStatus(), $listStateToSync)) { $content = $sync->syncOrder($order);
$sync = new \IpSupply\SyncOrder\Sync\Index; $this->_saveLog($content);
$content = $sync->syncOrder($order);
$this->_saveLog($content);
}
} }
} }