-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from mageplaza/2.4-develop
merge branch 2.4 develop intp 2.4
- Loading branch information
Showing
8 changed files
with
316 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_DeleteOrder | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
|
||
namespace Mageplaza\DeleteOrders\Plugin\Model; | ||
|
||
use Mageplaza\DeleteOrders\Helper\Data; | ||
use Magento\Sales\Model\Order as CoreOrder; | ||
|
||
/** | ||
* Class Order | ||
* @package Mageplaza\DeleteOrders\Plugin\Model | ||
*/ | ||
class Order | ||
{ | ||
/** | ||
* @var Data | ||
*/ | ||
protected $helper; | ||
|
||
/** | ||
* Order constructor. | ||
* @param Data $helper | ||
*/ | ||
public function __construct( | ||
Data $helper | ||
) { | ||
$this->helper = $helper; | ||
} | ||
|
||
/** | ||
* @param CoreOrder $order | ||
* @return array | ||
*/ | ||
public function beforeUnhold(CoreOrder $order) | ||
{ | ||
if (!$this->helper->isEnabled()) { | ||
return []; | ||
} | ||
|
||
if ($order->getStatus() !== $order->getState() && $order->getStatus() === CoreOrder::STATE_HOLDED) { | ||
$order->setState(CoreOrder::STATE_HOLDED); | ||
} | ||
|
||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_DeleteOrders | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<type name="Magento\Sales\Block\Adminhtml\Order\View"> | ||
<plugin name="delete_order_add_button_delete" type="Mageplaza\DeleteOrders\Plugin\Order\AddDeleteButton"/> | ||
</type> | ||
<type name="Magento\Ui\Component\MassAction"> | ||
<plugin name="delete_order_add_massaction_delete" type="Mageplaza\DeleteOrders\Plugin\Order\AddDeleteAction"/> | ||
</type> | ||
</config> | ||
<?xml version="1.0"?> | ||
<!-- | ||
/** | ||
* Mageplaza | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Mageplaza.com license that is | ||
* available through the world-wide-web at this URL: | ||
* https://www.mageplaza.com/LICENSE.txt | ||
* | ||
* DISCLAIMER | ||
* | ||
* Do not edit or add to this file if you wish to upgrade this extension to newer | ||
* version in the future. | ||
* | ||
* @category Mageplaza | ||
* @package Mageplaza_DeleteOrders | ||
* @copyright Copyright (c) Mageplaza (https://www.mageplaza.com/) | ||
* @license https://www.mageplaza.com/LICENSE.txt | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<type name="Magento\Sales\Block\Adminhtml\Order\View"> | ||
<plugin name="delete_order_add_button_delete" type="Mageplaza\DeleteOrders\Plugin\Order\AddDeleteButton"/> | ||
</type> | ||
<type name="Magento\Ui\Component\MassAction"> | ||
<plugin name="delete_order_add_massaction_delete" type="Mageplaza\DeleteOrders\Plugin\Order\AddDeleteAction"/> | ||
</type> | ||
<type name="Magento\Sales\Model\Order"> | ||
<plugin name="delete_order_hold_on" type="Mageplaza\DeleteOrders\Plugin\Model\Order"/> | ||
</type> | ||
</config> |
Oops, something went wrong.