Skip to content

Commit

Permalink
Merge pull request #51 from feedaty/develop
Browse files Browse the repository at this point in the history
Fix Invalid argument supplied for foreach() in Cron/Orders.php on lin…
  • Loading branch information
altravista committed Feb 23, 2022
2 parents fa414f0 + 9eb17f2 commit 37cf576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Cron/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function execute()
'Culture' => $localeCode,
'Platform' => $this->ordersHelper->getPlatform(),
'Products' => []

];

foreach ($items as $item){
Expand Down Expand Up @@ -114,10 +113,12 @@ public function execute()
$response = (array) $this->webService->sendOrder($data);

if(!empty($response)){
foreach ($response['Data'] as $data){
//if order Success or Duplicated set Feedaty Customer Notification true
if($data['Status'] == '1' || $data['Status'] == '201'){
$this->ordersHelper->setFeedatyCustomerNotified((int)$data['OrderID']);
if(isset($response['Data'])){
foreach ($response['Data'] as $data){
//if order Success or Duplicated set Feedaty Customer Notification true
if($data['Status'] == '1' || $data['Status'] == '201'){
$this->ordersHelper->setFeedatyCustomerNotified((int)$data['OrderID']);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"AFL-3.0"
],

"version": "2.7.4-stable",
"version": "2.7.5-stable",


"type": "magento2-module",
Expand Down

0 comments on commit 37cf576

Please sign in to comment.