The preOrderStatusUpdate
hook is called before the order status is updated.
\Isotope\Model\ProductCollection\Order $order
The order model.
\Isotope\Model\OrderStatus $newStatus
The new order status.
array $updates
The order status updates.
Return true
to cancel the order status change.
// src/EventListener/Isotope/PreOrderStatusUpdateListener.php
namespace App\EventListener\Isotope;
use Isotope\Model\OrderStatus;
use Isotope\Model\ProductCollection\Order;
use Isotope\ServiceAnnotation\IsotopeHook;
/**
* @IsotopeHook("preOrderStatusUpdate")
*/
class PreOrderStatusUpdateListener
{
public function __invoke(Order $order, OrderStatus $newsStatus, array $updates): bool
{
// Cancel the order status change if the order is not paid.
if (!$order->isPaid()) {
return true;
}
return false;
}
}