diff --git a/.github/no-response.yml b/.github/no-response.yml index 06a2899..64568da 100644 --- a/.github/no-response.yml +++ b/.github/no-response.yml @@ -1,13 +1,13 @@ -# Configuration for probot-no-response - https://github.com/probot/no-response - -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 7 -# Label requiring a response -responseRequiredLabel: waiting-customer-response -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to our request for more information from the original author. With only the - information that is currently in the issue, we don't have enough information - to take action. Please reach out if you have or find the answers we need so - that we can investigate further. +# Configuration for probot-no-response - https://github.com/probot/no-response + +# Number of days of inactivity before an Issue is closed for lack of response +daysUntilClose: 7 +# Label requiring a response +responseRequiredLabel: waiting-customer-response +# Comment to post when closing an Issue for lack of response. Set to `false` to disable +closeComment: > + This issue has been automatically closed because there has been no response + to our request for more information from the original author. With only the + information that is currently in the issue, we don't have enough information + to take action. Please reach out if you have or find the answers we need so + that we can investigate further. diff --git a/.travis.yml b/.travis.yml index 97fafaf..28b985c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,68 +1,68 @@ -language: php -php: - - 7.0 - - 7.1 -sudo: required -dist: trusty -env: - global: - - COMPOSER_BIN_DIR=~/bin - - INTEGRATION_SETS=3 - - NODE_JS_VERSION=6 - - MAGENTO_HOST_NAME="magento2.travis" - - COMPOSER_MODULE=mageplaza/module-delete-orders - matrix: - - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1 - - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2 - - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3 - - MAGENTO_VERSION=2.2.2 TEST_SUITE=static - - MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static - - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1 - - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2 - - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3 - - MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=1 - - MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=2 - - MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=3 - - MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=1 - - MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=2 - - MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=3 - -matrix: - exclude: - - php: 7.0 - env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static - - php: 7.0 - env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static -cache: - apt: true - directories: - - "$HOME/.composer/cache" - - "$HOME/.nvm" -addons: - apt: - packages: - - mysql-server-5.6 - - mysql-client-core-5.6 - - mysql-client-5.6 - - postfix - firefox: '46.0' - hosts: - - magento2.travis -before_install: - - git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION - - cd magento2 - - bash ./dev/travis/before_install.sh -install: - - composer install --no-interaction --prefer-dist - - composer require $COMPOSER_MODULE -before_script: - #- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/ - - echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt - - echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt - - echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt - - bash ./dev/travis/before_script.sh -script: - - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true - - test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true - - +language: php +php: + - 7.0 + - 7.1 +sudo: required +dist: trusty +env: + global: + - COMPOSER_BIN_DIR=~/bin + - INTEGRATION_SETS=3 + - NODE_JS_VERSION=6 + - MAGENTO_HOST_NAME="magento2.travis" + - COMPOSER_MODULE=mageplaza/module-delete-orders + matrix: + - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=1 + - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=2 + - MAGENTO_VERSION=2.2.1 TEST_SUITE=integration INTEGRATION_INDEX=3 + - MAGENTO_VERSION=2.2.2 TEST_SUITE=static + - MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static + - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=1 + - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=2 + - MAGENTO_VERSION=2.2.2 TEST_SUITE=integration INTEGRATION_INDEX=3 + - MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=1 + - MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=2 + - MAGENTO_VERSION=2.2.5 TEST_SUITE=integration INTEGRATION_INDEX=3 + - MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=1 + - MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=2 + - MAGENTO_VERSION=2.2.6 TEST_SUITE=integration INTEGRATION_INDEX=3 + +matrix: + exclude: + - php: 7.0 + env: MAGENTO_VERSION=2.2.2 TEST_SUITE=js GRUNT_COMMAND=static + - php: 7.0 + env: MAGENTO_VERSION=2.2.2 TEST_SUITE=static +cache: + apt: true + directories: + - "$HOME/.composer/cache" + - "$HOME/.nvm" +addons: + apt: + packages: + - mysql-server-5.6 + - mysql-client-core-5.6 + - mysql-client-5.6 + - postfix + firefox: '46.0' + hosts: + - magento2.travis +before_install: + - git clone https://github.com/magento/magento2 --branch $MAGENTO_VERSION + - cd magento2 + - bash ./dev/travis/before_install.sh +install: + - composer install --no-interaction --prefer-dist + - composer require $COMPOSER_MODULE +before_script: + #- cp -f ${TRAVIS_BUILD_DIR}/dev/tests/integration/phpunit.xml.dist dev/tests/integration/ + - echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Less/_files/whitelist/common.txt + - echo "vendor/$COMPOSER_MODULE" > dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt + - echo "vendor/$COMPOSER_MODULE/**/*.js" > dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/magento.txt + - bash ./dev/travis/before_script.sh +script: + - test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true + - test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true + + diff --git a/Console/Delete.php b/Console/Delete.php index 468a623..22c77d7 100644 --- a/Console/Delete.php +++ b/Console/Delete.php @@ -63,6 +63,7 @@ class Delete extends Command /** * Delete constructor. + * * @param HelperData $helperData * @param OrderRepository $orderRepository * @param State $state @@ -76,10 +77,10 @@ public function __construct( Registry $registry, $name = null ) { - $this->_helperData = $helperData; + $this->_helperData = $helperData; $this->orderRepository = $orderRepository; - $this->state = $state; - $this->registry = $registry; + $this->state = $state; + $this->registry = $registry; parent::__construct($name); } diff --git a/Controller/Adminhtml/Delete/Manually.php b/Controller/Adminhtml/Delete/Manually.php index 52d88a9..6cfd42b 100644 --- a/Controller/Adminhtml/Delete/Manually.php +++ b/Controller/Adminhtml/Delete/Manually.php @@ -27,8 +27,11 @@ use Magento\Framework\App\ResponseInterface; use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultInterface; +use Magento\Sales\Api\OrderManagementInterface; use Magento\Sales\Model\OrderRepository; +use Magento\Store\Model\StoreManagerInterface; use Mageplaza\DeleteOrders\Helper\Data as HelperData; +use Mageplaza\DeleteOrders\Helper\Email; use Psr\Log\LoggerInterface; /** @@ -53,22 +56,47 @@ class Manually extends Action */ protected $logger; + /** + * @var OrderManagementInterface + */ + protected $_orderManagement; + + /** + * @var Email + */ + protected $_email; + + /** + * @var StoreManagerInterface + */ + protected $_storeManager; + /** * Manually constructor. + * * @param Context $context * @param HelperData $helperData * @param OrderRepository $orderRepository * @param LoggerInterface $logger + * @param OrderManagementInterface $orderManagement + * @param Email $email + * @param StoreManagerInterface $storeManager */ public function __construct( Context $context, HelperData $helperData, OrderRepository $orderRepository, - LoggerInterface $logger + LoggerInterface $logger, + OrderManagementInterface $orderManagement, + Email $email, + StoreManagerInterface $storeManager ) { - $this->_helperData = $helperData; - $this->orderRepository = $orderRepository; - $this->logger = $logger; + $this->_helperData = $helperData; + $this->orderRepository = $orderRepository; + $this->logger = $logger; + $this->_orderManagement = $orderManagement; + $this->_email = $email; + $this->_storeManager = $storeManager; parent::__construct($context); } @@ -78,18 +106,29 @@ public function __construct( */ public function execute() { - $resultRedirect = $this->resultRedirectFactory->create(); - $storeId = $this->getRequest()->getParam('store'); - + $resultRedirect = $this->resultRedirectFactory->create(); + $storeId = $this->getRequest()->getParam('store'); + $status = ['processing', 'pending', 'fraud']; $orderCollection = $this->_helperData->getMatchingOrders($storeId); + if ($orderCollection->getSize()) { $successDelete = 0; - $errorOrders = []; + $errorOrders = []; + foreach ($orderCollection->getItems() as $order) { try { - $this->orderRepository->delete($order); - $this->_helperData->deleteRecord(reset($orderIds)); + if ($this->_helperData->versionCompare('2.3.0')) { + if (in_array($order->getStatus(), $status, true)) { + $this->_orderManagement->cancel($order->getId()); + } + if ($order->getStatus() === 'holded') { + $this->_orderManagement->unHold($order->getId()); + $this->_orderManagement->cancel($order->getId()); + } + } + $this->orderRepository->delete($order); + $this->_helperData->deleteRecord($order->getId()); $successDelete++; } catch (Exception $e) { $errorOrders[$order->getId()] = $order->getIncrementId(); @@ -102,7 +141,10 @@ public function execute() } if (count($errorOrders)) { - $this->messageManager->addSuccessMessage(__('The following orders cannot being deleted. %1', implode(', ', $errorOrders))); + $this->messageManager->addErrorMessage(__( + 'The following orders cannot being deleted. %1', + implode(', ', $errorOrders) + )); } } else { $this->messageManager->addNoticeMessage(__('No order has been deleted!')); diff --git a/Controller/Adminhtml/Order/Delete.php b/Controller/Adminhtml/Order/Delete.php index 2c2ecc2..8df59f0 100644 --- a/Controller/Adminhtml/Order/Delete.php +++ b/Controller/Adminhtml/Order/Delete.php @@ -22,7 +22,9 @@ namespace Mageplaza\DeleteOrders\Controller\Adminhtml\Order; use Exception; +use Magento\Framework\App\ObjectManager; use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\Result\Redirect; use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Exception\LocalizedException; use Magento\Sales\Controller\Adminhtml\Order; @@ -42,13 +44,15 @@ class Delete extends Order const ADMIN_RESOURCE = 'Magento_Sales::delete'; /** - * @return $this|ResponseInterface|ResultInterface + * @return ResponseInterface|Redirect|ResultInterface */ public function execute() { - $resultRedirect = $this->resultRedirectFactory->create(); - - $helper = $this->_objectManager->get(Data::class); + $resultRedirect = $this->resultRedirectFactory->create(); + $objectManager = ObjectManager::getInstance(); + $orderManagement = $objectManager->create('Magento\Sales\Api\OrderManagementInterface'); + $status = ['processing', 'pending', 'fraud']; + $helper = $this->_objectManager->get(Data::class); if (!$helper->isEnabled()) { $this->messageManager->addError(__('Cannot delete the order.')); @@ -60,6 +64,15 @@ public function execute() $order = $this->_initOrder(); if ($order) { try { + if ($helper->versionCompare('2.3.0')) { + if (in_array($order->getStatus(), $status)) { + $orderManagement->cancel($order->getId()); + } + if ($order->getStatus() === 'holded') { + $orderManagement->unHold($order->getId()); + $orderManagement->cancel($order->getId()); + } + } /** delete order*/ $this->orderRepository->delete($order); /** delete order data on grid report data related*/ diff --git a/Controller/Adminhtml/Order/MassDelete.php b/Controller/Adminhtml/Order/MassDelete.php index 6e5fac5..ccac4cf 100644 --- a/Controller/Adminhtml/Order/MassDelete.php +++ b/Controller/Adminhtml/Order/MassDelete.php @@ -29,6 +29,7 @@ use Magento\Framework\Controller\ResultInterface; use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; use Magento\Sales\Api\Data\OrderInterface; +use Magento\Sales\Api\OrderManagementInterface; use Magento\Sales\Controller\Adminhtml\Order\AbstractMassAction; use Magento\Sales\Model\OrderRepository; use Magento\Sales\Model\ResourceModel\Order\CollectionFactory; @@ -64,14 +65,21 @@ class MassDelete extends AbstractMassAction */ protected $logger; + /** + * @var OrderManagementInterface + */ + protected $_orderManagement; + /** * MassDelete constructor. + * * @param Context $context * @param Filter $filter * @param CollectionFactory $collectionFactory * @param OrderRepository $orderRepository * @param DataHelper $dataHelper * @param LoggerInterface $logger + * @param OrderManagementInterface $orderManagement */ public function __construct( Context $context, @@ -79,28 +87,40 @@ public function __construct( CollectionFactory $collectionFactory, OrderRepository $orderRepository, DataHelper $dataHelper, - LoggerInterface $logger + LoggerInterface $logger, + OrderManagementInterface $orderManagement ) { parent::__construct($context, $filter); $this->collectionFactory = $collectionFactory; - $this->orderRepository = $orderRepository; - $this->helper = $dataHelper; - $this->logger = $logger; + $this->orderRepository = $orderRepository; + $this->helper = $dataHelper; + $this->logger = $logger; + $this->_orderManagement = $orderManagement; } /** * @param AbstractCollection $collection + * * @return Redirect|ResponseInterface|ResultInterface */ protected function massAction(AbstractCollection $collection) { if ($this->helper->isEnabled()) { $deleted = 0; - + $status = ['processing', 'pending', 'fraud']; /** @var OrderInterface $order */ foreach ($collection->getItems() as $order) { try { + if ($this->helper->versionCompare('2.3.0')) { + if (in_array($order->getStatus(), $status, true)) { + $this->_orderManagement->cancel($order->getId()); + } + if ($order->getStatus() === 'holded') { + $this->_orderManagement->unHold($order->getId()); + $this->_orderManagement->cancel($order->getId()); + } + } /** delete order*/ $this->orderRepository->delete($order); /** delete order data on grid report data related*/ @@ -109,9 +129,13 @@ protected function massAction(AbstractCollection $collection) $deleted++; } catch (Exception $e) { $this->logger->critical($e); - $this->messageManager->addErrorMessage(__('Cannot delete order #%1. Please try again later.', $order->getIncrementId())); + $this->messageManager->addErrorMessage(__( + 'Cannot delete order #%1. Please try again later.', + $order->getIncrementId() + )); } } + if ($deleted) { $this->messageManager->addSuccessMessage(__('A total of %1 order(s) has been deleted.', $deleted)); } diff --git a/Cron/Manually.php b/Cron/Manually.php index bc5a2fe..b623b88 100644 --- a/Cron/Manually.php +++ b/Cron/Manually.php @@ -24,7 +24,9 @@ use Exception; use Magento\Framework\App\Area; use Magento\Framework\App\State; +use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Registry; +use Magento\Sales\Api\OrderManagementInterface; use Magento\Sales\Model\OrderRepository; use Magento\Store\Model\StoreManagerInterface; use Mageplaza\DeleteOrders\Helper\Data as HelperData; @@ -59,7 +61,7 @@ class Manually protected $orderRepository; /** - * @var state + * @var State */ protected $state; @@ -73,8 +75,14 @@ class Manually */ protected $logger; + /** + * @var OrderManagementInterface + */ + protected $_orderManagement; + /** * Manually constructor. + * * @param HelperData $helperData * @param Email $email * @param StoreManagerInterface $storeManager @@ -82,6 +90,7 @@ class Manually * @param State $state * @param Registry $registry * @param LoggerInterface $logger + * @param OrderManagementInterface $orderManagement */ public function __construct( HelperData $helperData, @@ -90,22 +99,25 @@ public function __construct( OrderRepository $orderRepository, state $state, Registry $registry, - LoggerInterface $logger + LoggerInterface $logger, + OrderManagementInterface $orderManagement ) { - $this->_helperData = $helperData; - $this->_email = $email; - $this->_storeManager = $storeManager; - $this->orderRepository = $orderRepository; - $this->state = $state; - $this->registry = $registry; - $this->logger = $logger; + $this->_helperData = $helperData; + $this->_email = $email; + $this->_storeManager = $storeManager; + $this->orderRepository = $orderRepository; + $this->state = $state; + $this->registry = $registry; + $this->logger = $logger; + $this->_orderManagement = $orderManagement; } /** - * action cron send email + * @throws LocalizedException */ public function process() { + $status = ['processing', 'pending', 'fraud']; foreach ($this->_storeManager->getStores() as $store) { $storeId = $store->getId(); if (!$this->_helperData->isEnabled($storeId)) { @@ -116,12 +128,21 @@ public function process() if ($numOfOrders = $orderCollection->getSize()) { $this->registry->unregister('isSecureArea'); $this->registry->register('isSecureArea', true); - $errorOrders = []; + foreach ($orderCollection->getItems() as $order) { try { + if ($this->_helperData->versionCompare('2.3.0')) { + if (in_array($order->getStatus(), $status, true)) { + $this->_orderManagement->cancel($order->getId()); + } + if ($order->getStatus() === 'holded') { + $this->_orderManagement->unHold($order->getId()); + $this->_orderManagement->cancel($order->getId()); + } + } $this->orderRepository->delete($order); - $this->_helperData->deleteRecord(reset($orderIds)); + $this->_helperData->deleteRecord($order->getId()); } catch (Exception $e) { $errorOrders[$order->getId()] = $order->getIncrementId(); $this->logger->error($e->getMessage()); @@ -136,7 +157,7 @@ public function process() $templateParams = [ 'num_order' => $numOfOrders, 'success_order' => $numOfOrders - count($errorOrders), - 'error_order' => $errorOrders + 'error_order' => count($errorOrders) ]; $this->_email->sendEmailTemplate($templateParams, $storeId); diff --git a/Helper/Data.php b/Helper/Data.php index 4339aee..dbcb417 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -62,7 +62,7 @@ public function __construct( CollectionFactory $orderCollectionFactory, OrderFactory $orderResourceFactory ) { - $this->orderResourceFactory = $orderResourceFactory; + $this->orderResourceFactory = $orderResourceFactory; $this->orderCollectionFactory = $orderCollectionFactory; parent::__construct($context, $objectManager, $storeManager); @@ -73,6 +73,7 @@ public function __construct( * * @param null $storeId * @param int $limit + * * @return Collection */ public function getMatchingOrders($storeId = null, $limit = 1000) @@ -117,7 +118,7 @@ public function getMatchingOrders($storeId = null, $limit = 1000) public function deleteRecord($orderId) { /** @var Order $resource */ - $resource = $this->orderResourceFactory->create(); + $resource = $this->orderResourceFactory->create(); $connection = $resource->getConnection(); /** delete invoice grid record via resource model*/ diff --git a/Helper/Email.php b/Helper/Email.php index 5f4427d..60d6424 100644 --- a/Helper/Email.php +++ b/Helper/Email.php @@ -37,7 +37,7 @@ */ class Email extends AbstractData { - const CONFIG_MODULE_PATH = 'delete_orders'; + const CONFIG_MODULE_PATH = 'delete_orders'; const EMAIL_CONFIGURATION = '/email'; /** @@ -67,7 +67,7 @@ public function __construct( HelperData $helperData ) { $this->transportBuilder = $transportBuilder; - $this->_helperData = $helperData; + $this->_helperData = $helperData; parent::__construct($context, $objectManager, $storeManager); } @@ -82,7 +82,6 @@ public function sendEmailTemplate($templateParams = [], $storeId = null) { try { $toEmails = $this->getToEmail($storeId); - foreach ($toEmails as $toEmail) { $transport = $this->transportBuilder ->setTemplateIdentifier($this->getTemplate($storeId)) @@ -124,7 +123,7 @@ public function getConfigEmail($code = '', $storeId = null) public function isEnabledEmail($storeId = null) { if ($this->_helperData->isEnabled()) { - return (bool)$this->getConfigEmail('enabled', $storeId); + return (bool) $this->getConfigEmail('enabled', $storeId); } return false; diff --git a/LICENSE b/LICENSE index 87b119f..9e08325 100644 --- a/LICENSE +++ b/LICENSE @@ -1,33 +1,33 @@ -Copyright © 2016-present Mageplaza Co. Ltd. - -This License is entered by Mageplaza to govern the usage or redistribution of Mageplaza software. This is a legal agreement between you (either an individual or a single entity) and Mageplaza for Mageplaza software product(s) which may include extensions, templates and services. - -By purchasing, installing, or otherwise using Mageplaza products, you acknowledge that you have read this License and agree to be bound by the terms of this Agreement. If you do not agree to the terms of this License, do not install or use Mageplaza products. - -The Agreement becomes effective at the moment when you acquire software from our site or receive it through email or on data medium or by any other means. Mageplaza reserves the right to make reasonable changes to the terms of this license agreement and impose its clauses at any given time. - - 1. GRANT OF LICENSE: By purchasing a product of Mageplaza: - - 1. Customer will receive source code open 100%. - - 2. Customer will obtain a License Certificate which will remain valid until the Customer stops using the Product or until Mageplaza terminates this License because of Customer’s failure to comply with any of its Terms and Conditions. Each License Certificate includes a license serial which is valid for one live Magento installation only and unlimited test Magento installations. - - 3. You are allowed to customize our products to fit with your using purpose. - - 4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS - - 5. Installation and Use - - 6. For each new Software installation, you are obliged to purchase a separate License. You are not permitted to use any part of the code in whole or part in any other software or product or website. You are legally bound to preserve the copyright information intact including the text/link at bottom. - - 2. Distribution: You are not allowed to distribute Mageplaza software to third parties. Any distribution without our permission, including non commercial distribution is considered as violation of this Agreement and entails liability, according to the current law. You may not place the Software onto a server that allows access to the Software via a public network or the Internet for distribution purposes. - - 3. Rental: You may not give, sell, sub-license, rent, lease or lend any portion of the Software to anyone. - - 4. Compliance with Applicable Laws: You must comply with all applicable laws regarding use of software products. Mageplaza software and a portion of it are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Accordingly, customer is required to treat the software like any other copyrighted material. Any activity violating copyright law will be prosecuted according to the current law. We retain the right to revoke the license of any user holding an invalid license. - - 5. TERMINATION: Without prejudice to any other rights, Mageplaza may terminate this License at any time if you fail to comply with the terms and conditions of this License. In such event, it constitutes a breach of the agreement, and your license to use the program is revoked and you must destroy all copies of Mageplaza products in your possession. After being notified of termination of your license, if you continue to use Mageplaza software, you hereby agree to accept an injunction to prevent you from its further use and to pay all costs (including but not limited to reasonable attorney fees) to enforce our revocation of your license and any damages suffered by us because of your misuse of the Software. We are not bound to return you the amount spent for purchase of the Software for the termination of this License. - - 6. LIMITATION OF LIABILITY: In no event shall Mageplaza be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) rising out of ‘Authorized Users’ use of or inability to use the Mageplaza products, even if Mageplaza has been advised of the possibility of such damages. In no event will Mageplaza be liable for prosecution arising from use of the Software against law or for any illegal use. - +Copyright © 2016-present Mageplaza Co. Ltd. + +This License is entered by Mageplaza to govern the usage or redistribution of Mageplaza software. This is a legal agreement between you (either an individual or a single entity) and Mageplaza for Mageplaza software product(s) which may include extensions, templates and services. + +By purchasing, installing, or otherwise using Mageplaza products, you acknowledge that you have read this License and agree to be bound by the terms of this Agreement. If you do not agree to the terms of this License, do not install or use Mageplaza products. + +The Agreement becomes effective at the moment when you acquire software from our site or receive it through email or on data medium or by any other means. Mageplaza reserves the right to make reasonable changes to the terms of this license agreement and impose its clauses at any given time. + + 1. GRANT OF LICENSE: By purchasing a product of Mageplaza: + + 1. Customer will receive source code open 100%. + + 2. Customer will obtain a License Certificate which will remain valid until the Customer stops using the Product or until Mageplaza terminates this License because of Customer’s failure to comply with any of its Terms and Conditions. Each License Certificate includes a license serial which is valid for one live Magento installation only and unlimited test Magento installations. + + 3. You are allowed to customize our products to fit with your using purpose. + + 4. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS + + 5. Installation and Use + + 6. For each new Software installation, you are obliged to purchase a separate License. You are not permitted to use any part of the code in whole or part in any other software or product or website. You are legally bound to preserve the copyright information intact including the text/link at bottom. + + 2. Distribution: You are not allowed to distribute Mageplaza software to third parties. Any distribution without our permission, including non commercial distribution is considered as violation of this Agreement and entails liability, according to the current law. You may not place the Software onto a server that allows access to the Software via a public network or the Internet for distribution purposes. + + 3. Rental: You may not give, sell, sub-license, rent, lease or lend any portion of the Software to anyone. + + 4. Compliance with Applicable Laws: You must comply with all applicable laws regarding use of software products. Mageplaza software and a portion of it are protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Accordingly, customer is required to treat the software like any other copyrighted material. Any activity violating copyright law will be prosecuted according to the current law. We retain the right to revoke the license of any user holding an invalid license. + + 5. TERMINATION: Without prejudice to any other rights, Mageplaza may terminate this License at any time if you fail to comply with the terms and conditions of this License. In such event, it constitutes a breach of the agreement, and your license to use the program is revoked and you must destroy all copies of Mageplaza products in your possession. After being notified of termination of your license, if you continue to use Mageplaza software, you hereby agree to accept an injunction to prevent you from its further use and to pay all costs (including but not limited to reasonable attorney fees) to enforce our revocation of your license and any damages suffered by us because of your misuse of the Software. We are not bound to return you the amount spent for purchase of the Software for the termination of this License. + + 6. LIMITATION OF LIABILITY: In no event shall Mageplaza be liable for any damages (including, without limitation, lost profits, business interruption, or lost information) rising out of ‘Authorized Users’ use of or inability to use the Mageplaza products, even if Mageplaza has been advised of the possibility of such damages. In no event will Mageplaza be liable for prosecution arising from use of the Software against law or for any illegal use. + The latest License: https://www.mageplaza.com/LICENSE.txt \ No newline at end of file diff --git a/Model/Config/Backend/Order/Frequency.php b/Model/Config/Backend/Order/Frequency.php index 175ec7a..e84664d 100644 --- a/Model/Config/Backend/Order/Frequency.php +++ b/Model/Config/Backend/Order/Frequency.php @@ -90,9 +90,9 @@ public function __construct( $runModelPath = '', array $data = [] ) { - $this->_runModelPath = $runModelPath; + $this->_runModelPath = $runModelPath; $this->_configValueFactory = $configValueFactory; - $this->messageManager = $messageManager; + $this->messageManager = $messageManager; parent::__construct( $context, @@ -110,13 +110,13 @@ public function __construct( */ public function afterSave() { - $time = $this->getData('groups/schedule/fields/time/value'); + $time = $this->getData('groups/schedule/fields/time/value'); $frequency = $this->getData('groups/schedule/fields/schedule_for/value'); if ($frequency !== ValueConfig::DISABLE) { $cronExprArray = [ - (int)$time[1], //Minute - (int)$time[0], //Hour + (int) $time[1], //Minute + (int) $time[0], //Hour $frequency === \Magento\Cron\Model\Config\Source\Frequency::CRON_MONTHLY ? '1' : '*', //Day of the Month '*', //Month of the Year $frequency === \Magento\Cron\Model\Config\Source\Frequency::CRON_WEEKLY ? '1' : '*', //Day of the Week diff --git a/Model/Config/Source/Country.php b/Model/Config/Source/Country.php index c22cf61..b0235c7 100644 --- a/Model/Config/Source/Country.php +++ b/Model/Config/Source/Country.php @@ -31,7 +31,7 @@ class Country implements ArrayInterface { const SPECIFIC = '1'; - const ALL = '2'; + const ALL = '2'; /** * Return array of options as value-label pairs diff --git a/Plugin/Order/AddDeleteAction.php b/Plugin/Order/AddDeleteAction.php index 466536b..36d8b89 100644 --- a/Plugin/Order/AddDeleteAction.php +++ b/Plugin/Order/AddDeleteAction.php @@ -43,6 +43,7 @@ class AddDeleteAction /** * AddDeleteAction constructor. + * * @param Data $helper * @param AuthorizationInterface $authorization */ @@ -50,13 +51,14 @@ public function __construct( Data $helper, AuthorizationInterface $authorization ) { - $this->helper = $helper; + $this->helper = $helper; $this->_authorization = $authorization; } /** * @param MassAction $object * @param $result + * * @return mixed */ public function afterGetChildComponents(MassAction $object, $result) diff --git a/Plugin/Order/AddDeleteButton.php b/Plugin/Order/AddDeleteButton.php index 9787d55..8579ab7 100644 --- a/Plugin/Order/AddDeleteButton.php +++ b/Plugin/Order/AddDeleteButton.php @@ -44,6 +44,7 @@ class AddDeleteButton /** * AddDeleteButton constructor. + * * @param Data $helper * @param AuthorizationInterface $authorization */ @@ -51,13 +52,14 @@ public function __construct( Data $helper, AuthorizationInterface $authorization ) { - $this->helper = $helper; + $this->helper = $helper; $this->_authorization = $authorization; } /** * @param View $object * @param LayoutInterface $layout + * * @return array */ public function beforeSetLayout(View $object, LayoutInterface $layout) diff --git a/README.md b/README.md index 4d81e9f..1477306 100644 --- a/README.md +++ b/README.md @@ -1,105 +1,105 @@ -# Magento 2 Delete Orders free by Mageplaza - -**Magento 2 Delete Orders** by Mageplaza helps admins completely remove unnecessary orders, invoices, shipments and credit memos which are arised during testing process. This helps simplify order management and get these arranged neater. - - -## Highlight features - -- Delete mass orders -- Ability to delete all -- Delete related data safely - - -[![Latest Stable Version](https://poser.pugx.org/mageplaza/module-delete-orders/v/stable)](https://packagist.org/packages/mageplaza/module-delete-orders) -[![Total Downloads](https://poser.pugx.org/mageplaza/module-delete-orders/downloads)](https://packagist.org/packages/mageplaza/module-delete-orders) - - -## 1. Documentation - -- [Installation guide](https://www.mageplaza.com/install-magento-2-extension/) -- [User guide](http://docs.mageplaza.com/delete-order-m2/index.html) -- [Introduction page](https://www.mageplaza.com/magento-2-delete-orders/) -- [Get Support](https://github.com/mageplaza/magento-2-delete-orders/issues) -- [Contribute on Github](https://github.com/mageplaza/magento-2-delete-orders) -- [Changelog](https://github.com/mageplaza/magento-2-delete-orders/releases) -- [License](https://www.mageplaza.com/LICENSE.txt) - -## 2. FAQs - -#### Q: I got error: `Mageplaza_Core has been already defined` -A: Read solution: https://github.com/mageplaza/module-core/issues/3 - - -## 3. How to install - - -## ✓ Install via composer (recommend) -Run the following command in Magento 2 root folder: - -``` -composer require mageplaza/module-delete-orders -php bin/magento setup:upgrade -php bin/magento setup:static-content:deploy -``` - - -## 4. Problems & Solutions - -Before applying any new changes in an online store, store admins have to carry quite many tests. This testing process can arise a number of orders, invoices, shipments and credit memos which are obviously unnecessary in long term and they can cause difficulties in management. Unfortunately, default Magento 2 doesn’t support any functionalities to remove them from the backend. This consequently causes frustration and inconvenience in administration. - -There should be a way to deal with this problem, Mageplaza Delete Orders extension is developed to help store admins simplify this task. The module helps delete orders, invoices, shipments and credit memos from the backend but keeps the retire data safe. The job can be done in the blink of an eye with mass deleting feature and ability to delete all. - -## 5. Why online stores must have Mageplaza Delete Orders - -### To keep the backend well-arranged and neat -The appearance of test orders makes a store’s backend look like a mess. Thus cuts in unnecessary orders, shipments, invoices and credit memos created for testing will make everything neater, easier to follow and less confusing. - -### To manage the backend more easily -The large number of test orders can confuse store admins and this can cause inconvenience or mistakes in managing. Having a neater backend will simplify order management. - - -## 6. Features - -![magento 2 delete orders](https://cdn.mageplaza.com/media/general/GKcj6HQ.png) - -### Delete mass test orders - -To remove one order, store admins only need to manipulate with few clicks. Also, many orders created for testing purposes can be remove completely in a large number simultaneously by checking multiple desired items and clicking on Delete. Other related data will be removed along with the orders without any risks to affect the rest data. - -### Delete all - -Store admins are able to delete all test orders, invoices, shipments and credit memos really easily by performing some clicks. There will always be a confirmation step at the end to make sure everything is done right before all are eased from the backend. Hence, store admins can be carefree when they delete all orders simultaneously. - -### Delete related information in safety - -While deleting orders, invoices, shipments and credit memos, their related data will be removed from the backend also. However, Mageplaza Delete Orders extension will make sure that the rest data can be kept safe. No harm is caused with other necessary information. - -## 7. More features - -- Mageplaza Delete Orders for Magento 2 is totally open-source -- The module supports multi stores -- Multiple languages are supported -- It’s easy to customize -- Mageplaza provides a well-documented user guide for Delete Orders extension - -**People also search:** -- magento 2 delete order -- magento 2 remove orders -- magento 2 delete test orders -- magento 2 delete order extension -- mageplaza delete order -- magento 2 delete all orders -- magento 2 delete order extension free -- magento 2 remove all orders -- magento 2 delete orders from database - - -**Other free Magnto 2 extension on Github** -- [Magento 2 Google maps module](https://github.com/mageplaza/magento-2-google-maps) -- [Magento 2 GDPR](https://github.com/mageplaza/magento-2-gdpr) -- [Magento 2 Popup extension](https://github.com/mageplaza/magento-2-better-popup) -- [Magento 2 Reporting extension](https://github.com/mageplaza/magento-2-reports) -- [Magento 2 social login](https://github.com/mageplaza/magento-2-social-login) -- [Magento 2 blog extension](https://github.com/mageplaza/magento-2-blog) -- [Magento 2 Ajax Layered Navigation](https://github.com/mageplaza/magento-2-ajax-layered-navigation) -- [Magento 2 security](https://github.com/mageplaza/magento-2-security) +# Magento 2 Delete Orders free by Mageplaza + +**Magento 2 Delete Orders** by Mageplaza helps admins completely remove unnecessary orders, invoices, shipments and credit memos which are arised during testing process. This helps simplify order management and get these arranged neater. + + +## Highlight features + +- Delete mass orders +- Ability to delete all +- Delete related data safely + + +[![Latest Stable Version](https://poser.pugx.org/mageplaza/module-delete-orders/v/stable)](https://packagist.org/packages/mageplaza/module-delete-orders) +[![Total Downloads](https://poser.pugx.org/mageplaza/module-delete-orders/downloads)](https://packagist.org/packages/mageplaza/module-delete-orders) + + +## 1. Documentation + +- [Installation guide](https://www.mageplaza.com/install-magento-2-extension/) +- [User guide](http://docs.mageplaza.com/delete-order-m2/index.html) +- [Introduction page](https://www.mageplaza.com/magento-2-delete-orders/) +- [Get Support](https://github.com/mageplaza/magento-2-delete-orders/issues) +- [Contribute on Github](https://github.com/mageplaza/magento-2-delete-orders) +- [Changelog](https://github.com/mageplaza/magento-2-delete-orders/releases) +- [License](https://www.mageplaza.com/LICENSE.txt) + +## 2. FAQs + +#### Q: I got error: `Mageplaza_Core has been already defined` +A: Read solution: https://github.com/mageplaza/module-core/issues/3 + + +## 3. How to install + + +## ✓ Install via composer (recommend) +Run the following command in Magento 2 root folder: + +``` +composer require mageplaza/module-delete-orders +php bin/magento setup:upgrade +php bin/magento setup:static-content:deploy +``` + + +## 4. Problems & Solutions + +Before applying any new changes in an online store, store admins have to carry quite many tests. This testing process can arise a number of orders, invoices, shipments and credit memos which are obviously unnecessary in long term and they can cause difficulties in management. Unfortunately, default Magento 2 doesn’t support any functionalities to remove them from the backend. This consequently causes frustration and inconvenience in administration. + +There should be a way to deal with this problem, Mageplaza Delete Orders extension is developed to help store admins simplify this task. The module helps delete orders, invoices, shipments and credit memos from the backend but keeps the retire data safe. The job can be done in the blink of an eye with mass deleting feature and ability to delete all. + +## 5. Why online stores must have Mageplaza Delete Orders + +### To keep the backend well-arranged and neat +The appearance of test orders makes a store’s backend look like a mess. Thus cuts in unnecessary orders, shipments, invoices and credit memos created for testing will make everything neater, easier to follow and less confusing. + +### To manage the backend more easily +The large number of test orders can confuse store admins and this can cause inconvenience or mistakes in managing. Having a neater backend will simplify order management. + + +## 6. Features + +![magento 2 delete orders](https://cdn.mageplaza.com/media/general/GKcj6HQ.png) + +### Delete mass test orders + +To remove one order, store admins only need to manipulate with few clicks. Also, many orders created for testing purposes can be remove completely in a large number simultaneously by checking multiple desired items and clicking on Delete. Other related data will be removed along with the orders without any risks to affect the rest data. + +### Delete all + +Store admins are able to delete all test orders, invoices, shipments and credit memos really easily by performing some clicks. There will always be a confirmation step at the end to make sure everything is done right before all are eased from the backend. Hence, store admins can be carefree when they delete all orders simultaneously. + +### Delete related information in safety + +While deleting orders, invoices, shipments and credit memos, their related data will be removed from the backend also. However, Mageplaza Delete Orders extension will make sure that the rest data can be kept safe. No harm is caused with other necessary information. + +## 7. More features + +- Mageplaza Delete Orders for Magento 2 is totally open-source +- The module supports multi stores +- Multiple languages are supported +- It’s easy to customize +- Mageplaza provides a well-documented user guide for Delete Orders extension + +**People also search:** +- magento 2 delete order +- magento 2 remove orders +- magento 2 delete test orders +- magento 2 delete order extension +- mageplaza delete order +- magento 2 delete all orders +- magento 2 delete order extension free +- magento 2 remove all orders +- magento 2 delete orders from database + + +**Other free Magnto 2 extension on Github** +- [Magento 2 Google maps module](https://github.com/mageplaza/magento-2-google-maps) +- [Magento 2 GDPR](https://github.com/mageplaza/magento-2-gdpr) +- [Magento 2 Popup extension](https://github.com/mageplaza/magento-2-better-popup) +- [Magento 2 Reporting extension](https://github.com/mageplaza/magento-2-reports) +- [Magento 2 social login](https://github.com/mageplaza/magento-2-social-login) +- [Magento 2 blog extension](https://github.com/mageplaza/magento-2-blog) +- [Magento 2 Ajax Layered Navigation](https://github.com/mageplaza/magento-2-ajax-layered-navigation) +- [Magento 2 security](https://github.com/mageplaza/magento-2-security) diff --git a/USER-GUIDE.md b/USER-GUIDE.md index c5c2c9a..633c71e 100644 --- a/USER-GUIDE.md +++ b/USER-GUIDE.md @@ -1,32 +1,32 @@ -# Delete Orders User Guide - -## Documentation -- Installation guide: https://www.mageplaza.com/install-magento-2-extension/ -- User guide: http://docs.mageplaza.com/delete-order-m2/index.html -- Introduction page: https://www.mageplaza.com/magento-2-delete-orders/ -- Get Support: https://github.com/mageplaza/magento-2-delete-orders/issues -- Contribute on Github: https://github.com/mageplaza/magento-2-delete-orders -- Changelog: https://www.mageplaza.com/releases/delete-orders -- License https://www.mageplaza.com/LICENSE.txt - - -## How to install - -### Install via composer [Recommend] - -Run the following command in Magento 2 root folder - -``` -composer require mageplaza/module-delete-orders -php bin/magento setup:upgrade -php bin/magento setup:static-content:deploy -``` - - -## FAQs - -#### Q: I got error: `Mageplaza_Core has been already defined` -A: Read solution: https://github.com/mageplaza/module-core/issues/3 - -#### Q: My site is down -A: Please follow this guide: https://www.mageplaza.com/blog/magento-site-down.html +# Delete Orders User Guide + +## Documentation +- Installation guide: https://www.mageplaza.com/install-magento-2-extension/ +- User guide: http://docs.mageplaza.com/delete-order-m2/index.html +- Introduction page: https://www.mageplaza.com/magento-2-delete-orders/ +- Get Support: https://github.com/mageplaza/magento-2-delete-orders/issues +- Contribute on Github: https://github.com/mageplaza/magento-2-delete-orders +- Changelog: https://www.mageplaza.com/releases/delete-orders +- License https://www.mageplaza.com/LICENSE.txt + + +## How to install + +### Install via composer [Recommend] + +Run the following command in Magento 2 root folder + +``` +composer require mageplaza/module-delete-orders +php bin/magento setup:upgrade +php bin/magento setup:static-content:deploy +``` + + +## FAQs + +#### Q: I got error: `Mageplaza_Core has been already defined` +A: Read solution: https://github.com/mageplaza/module-core/issues/3 + +#### Q: My site is down +A: Please follow this guide: https://www.mageplaza.com/blog/magento-site-down.html diff --git a/composer.json b/composer.json index 21d481b..8de51fd 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,26 @@ -{ - "name": "mageplaza/module-delete-orders", - "description": "Magento 2 Delete Orders extension", - "require": { - "mageplaza/module-core": "^1.4.3" - }, - "type": "magento2-module", - "version": "1.2.0", - "license": "proprietary", - "authors": [ - { - "name": "Mageplaza", - "email": "support@mageplaza.com", - "homepage": "https://www.mageplaza.com", - "role": "Technical Support" - } - ], - "autoload": { - "files": [ - "registration.php" - ], - "psr-4": { - "Mageplaza\\DeleteOrders\\": "" - } - } -} +{ + "name": "mageplaza/module-delete-orders", + "description": "Magento 2 Delete Orders extension", + "require": { + "mageplaza/module-core": "^1.4.5" + }, + "type": "magento2-module", + "version": "1.2.1", + "license": "proprietary", + "authors": [ + { + "name": "Mageplaza", + "email": "support@mageplaza.com", + "homepage": "https://www.mageplaza.com", + "role": "Technical Support" + } + ], + "autoload": { + "files": [ + "registration.php" + ], + "psr-4": { + "Mageplaza\\DeleteOrders\\": "" + } + } +} diff --git a/etc/acl.xml b/etc/acl.xml index 2936316..4bbfa37 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml index 8ed3020..6e9841d 100644 --- a/etc/adminhtml/di.xml +++ b/etc/adminhtml/di.xml @@ -1,30 +1,30 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/etc/adminhtml/routes.xml b/etc/adminhtml/routes.xml index 3adaec7..8c1dd60 100644 --- a/etc/adminhtml/routes.xml +++ b/etc/adminhtml/routes.xml @@ -1,28 +1,28 @@ - - - - - - - - + + + + + + + + diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index f112b33..37bdfc5 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,119 +1,120 @@ - - - -
- separator-top - - mageplaza - Mageplaza_DeleteOrders::configuration - - - - - Magento\Config\Model\Config\Source\Yesno - Select Yes to enable this module - - - - - - - Mageplaza\DeleteOrders\Model\Config\Source\Frequency - Mageplaza\DeleteOrders\Model\Config\Backend\Order\Frequency - Set up the schedule in which orders are deleted automatically. - - - - - D|W|M - - - - - validate-number - For example, today is Sunday this week. If you set the period as 7 days, all the orders before Sunday last week will be deleted (if they meet the below conditions). - - - - Magento\Sales\Model\Config\Source\Order\Status - - - - Magento\Customer\Model\Config\Source\Group - - - - Magento\Store\Model\System\Store - - - - Mageplaza\DeleteOrders\Model\Config\Source\Country - - - Magento\Directory\Model\Config\Source\Country - - 1 - - - - - validate-number - Less than or equal this amount - - - Mageplaza\DeleteOrders\Block\Adminhtml\System\Config\Manually - Click Run Manually to delete the orders which meet the above conditions anytime
- In case you want to delete a specific order, you can use command line
- php bin/magento order:delete order_id
- ]]> -
-
-
- - - - - Magento\Config\Model\Config\Source\Yesno - Email can be sent only when orders are deleted automatically by schedule.
- Install Mageplaza_SMTP to avoid sending to spam box. - ]]> -
-
- - - Magento\Config\Model\Config\Source\Email\Identity - - - - Magento\Config\Model\Config\Source\Email\Template - - - - Separated by comma(s) - -
-
-
-
+ + + +
+ separator-top + + mageplaza + Mageplaza_DeleteOrders::configuration + + + + + Magento\Config\Model\Config\Source\Yesno + Select Yes to enable this module + + + + + + + Mageplaza\DeleteOrders\Model\Config\Source\Frequency + Mageplaza\DeleteOrders\Model\Config\Backend\Order\Frequency + Set up the schedule in which orders are deleted automatically. + + + + + D|W|M + + + + + validate-number + For example, today is Sunday this week. If you set the period as 7 days, all the orders before Sunday last week will be deleted (if they meet the below conditions). + + + + Magento\Sales\Model\Config\Source\Order\Status + + + + Magento\Customer\Model\ResourceModel\Group\Collection + + + + Magento\Store\Model\System\Store + + + + Mageplaza\DeleteOrders\Model\Config\Source\Country + + + + Magento\Directory\Model\Config\Source\Country + + 1 + + + + + validate-number + Less than or equal this amount + + + Mageplaza\DeleteOrders\Block\Adminhtml\System\Config\Manually + Click Run Manually to delete the orders which meet the above conditions anytime
+ In case you want to delete a specific order, you can use command line
+ php bin/magento order:delete order_id
+ ]]> +
+
+
+ + + + + Magento\Config\Model\Config\Source\Yesno + Email can be sent only when orders are deleted automatically by schedule.
+ Install Mageplaza_SMTP to avoid sending to spam box. + ]]> +
+
+ + + Magento\Config\Model\Config\Source\Email\Identity + + + + Magento\Config\Model\Config\Source\Email\Template + + + + Separated by comma(s) + +
+
+
+
diff --git a/etc/config.xml b/etc/config.xml index f6ac8b8..a4b73ee 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,44 +1,44 @@ - - - - - - 1 - - - 1 - - - 0 - 0 - 0 - 2 - - - 0 - general - - - - + + + + + + 1 + + + 1 + + + 0 + 0 + 0 + 2 + + + 0 + general + + + + \ No newline at end of file diff --git a/etc/crontab.xml b/etc/crontab.xml index 4268f6c..1415a8a 100644 --- a/etc/crontab.xml +++ b/etc/crontab.xml @@ -1,29 +1,29 @@ - - - - - - crontab/default/jobs/delete_orders_cron_manually_email/schedule/cron_expr - - - + + + + + + crontab/default/jobs/delete_orders_cron_manually_email/schedule/cron_expr + + + diff --git a/etc/di.xml b/etc/di.xml index b65cc28..32c1334 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,31 +1,31 @@ - - - - - - - Mageplaza\DeleteOrders\Console\Delete - - - + + + + + + + Mageplaza\DeleteOrders\Console\Delete + + + \ No newline at end of file diff --git a/etc/email_templates.xml b/etc/email_templates.xml index fa1996f..0b796aa 100644 --- a/etc/email_templates.xml +++ b/etc/email_templates.xml @@ -1,25 +1,25 @@ - - - -