Skip to main content
added 42 characters in body
Source Link

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $payment = $order->getPayment();
    $order->setState('new');
    $order->setStatus('pending');
}

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $order->setState('new');
    $order->setStatus('pending');
}

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $payment = $order->getPayment();
    $order->setState('new');
    $order->setStatus('pending');
}
added 2 characters in body
Source Link
Manoj Deswal
  • 5.8k
  • 25
  • 28
  • 50

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $order->setState('new');
    $order->setStatus('pending');
}

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $order->setState('new');
    $order->setStatus('pending');
}

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $order->setState('new');
    $order->setStatus('pending');
}

events.xml

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

In the execute method of SalesOrderPlaceAfter.php

Create public function execute(Observer $observer) { Vendor/** @var Order $order *Module/ $order = $observer->getData('order'); $order->setState('new'); $order->setStatus('pending'); }Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $order->setState('new');
    $order->setStatus('pending');
}

events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

In the execute method of SalesOrderPlaceAfter.php

public function execute(Observer $observer) { /** @var Order $order */ $order = $observer->getData('order'); $order->setState('new'); $order->setStatus('pending'); }

Create file: etc/events.xml

<event name="sales_order_place_after">
    <observer name="sales_order_place_after_event" instance="Vendor\Module\Observer\SalesOrderPlaceAfter" />
</event>

Create Vendor/Module/Observer/SalesOrderPlaceAfter.php

public function execute(Observer $observer)
{
    /** @var Order $order */
    $order = $observer->getData('order');
    $order->setState('new');
    $order->setStatus('pending');
}
Source Link
Loading