diff --git a/Console/Delete.php b/Console/Delete.php
index 22c77d7..c038370 100644
--- a/Console/Delete.php
+++ b/Console/Delete.php
@@ -120,6 +120,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->_helperData->deleteRecord($orderId);
$output->writeln('The delete order process has been successful!');
+ return 0;
} catch (Exception $e) {
$output->writeln("{$e->getMessage()}");
}
diff --git a/Helper/Data.php b/Helper/Data.php
index 603746e..e22c99d 100644
--- a/Helper/Data.php
+++ b/Helper/Data.php
@@ -106,7 +106,8 @@ public function getMatchingOrders($storeId = null, $limit = 1000)
'main_table.entity_id = soa.parent_id',
[]
)
- ->where('soa.country_id IN (?)', $this->getCountriesConfig($storeId));
+ ->where('soa.country_id IN (?)', $this->getCountriesConfig($storeId))
+ ->where('soa.address_type IN (?)', 'shipping');
}
return $orderCollection;
@@ -167,7 +168,7 @@ public function getOrderStatusConfig($storeId = null)
*/
public function getOrderCustomerGroupConfig($storeId = null)
{
- return explode(',', $this->getScheduleConfig('customer_groups', $storeId));
+ return explode(',', (string)$this->getScheduleConfig('customer_groups', $storeId));
}
/**
diff --git a/composer.json b/composer.json
index e964252..b7fdce4 100644
--- a/composer.json
+++ b/composer.json
@@ -2,10 +2,10 @@
"name": "mageplaza/module-delete-orders",
"description": "Magento 2 Delete Orders extension",
"require": {
- "mageplaza/module-core": "^1.4.5"
+ "mageplaza/module-core": "^1.5.3"
},
"type": "magento2-module",
- "version": "4.0.1",
+ "version": "4.0.2",
"license": "proprietary",
"authors": [
{