Skip to content

Commit

Permalink
[PT-728] Order state processing when order is confirmed. (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
tikohov20 authored Dec 13, 2023
1 parent 9e3e113 commit 5c90c87
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
9 changes: 7 additions & 2 deletions Observer/AfterPlaceOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Mondu\Mondu\Observer;

use Magento\Framework\Event\Observer;
use Magento\Sales\Model\Order;
use Mondu\Mondu\Helpers\ContextHelper;
use Mondu\Mondu\Helpers\Logger\Logger;
use Mondu\Mondu\Helpers\PaymentMethod;
Expand Down Expand Up @@ -45,8 +46,12 @@ public function _execute(Observer $observer)
$order->addStatusHistoryComment(
__('Mondu: Order Status changed to Payment Review because it needs manual confirmation')
);
$order->setState(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW);
$order->setStatus(\Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW);
$order->setState(Order::STATE_PAYMENT_REVIEW);
$order->setStatus(Order::STATE_PAYMENT_REVIEW);
$order->save();
} else {
$order->setState(Order::STATE_PROCESSING);
$order->setStatus(Order::STATE_PROCESSING);
$order->save();
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mondu_gmbh/magento2-payment",
"description": "Mondu payment method for magento 2",
"type": "magento2-module",
"version": "2.2.2",
"version": "2.3.0",
"license": [
"MIT"
],
Expand Down
5 changes: 0 additions & 5 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@
<label>Installments by Invoice Description</label>
<config_path>payment/monduinstallmentbyinvoice/description</config_path>
</field>
<field id="order_status" translate="label" type="select" sortOrder="13" showInDefault="1" showInWebsite="1" canRestore="1">
<label>New Order Status</label>
<source_model>Magento\Sales\Model\Config\Source\Order\Status\NewStatus</source_model>
<config_path>payment/mondu/order_status</config_path>
</field>
<field id="allowspecific" translate="label" type="allowspecific" sortOrder="14" showInDefault="9"
showInWebsite="1" showInStore="1">
<label>Payment From Applicable Countries</label>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mondu_Mondu" setup_version="2.2.2">
<module name="Mondu_Mondu" setup_version="2.3.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down

0 comments on commit 5c90c87

Please sign in to comment.