When buy the product via PayPal, the payment status is changed to [in processing] but the order status is [open]. I am going to change order status from [open] to [in processing] when the payment status is [in processing].
So I made scheduled task plugin for this job.
In my plugin I implemented some query code to change order status.
But it is not working. I am not sure how I can do it. Please help me about this. Thank you
This is my scheduled task handler code
<?php declare(strict_types=1); namespace Change\OrderStatus\ScheduledTask; use Doctrine\DBAL\Connection; use Shopware\Core\Framework\MessageQueue\ScheduledTask\ScheduledTaskHandler; class ProcessOrderStatusHandler extends ScheduledTaskHandler { protected $connection; public function __construct( Connection $connection ) { $this->connection = $connection; } public static function getHandledMessages(): iterable { return [ ProcessOrderStatus::class ]; } public function run(): void { $this->connection->executeQuery( 'UPDATE `order` SET `order_number` = 111 WHERE `auto_increment` = 72' ); } }