Update the order status value
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Update the order status value
Hello,
This query updates the status delivery for the order number 2, but it doesn't store the value in the database.
Why?
This query updates the status delivery for the order number 2, but it doesn't store the value in the database.
Code: Select all
\Aimeos\MShop::create( $this->context(), 'order' )->get(2)->setStatusDelivery(2);
Why?
Re: Update the order status value
Still trying to understand all of this like you but can you try this ?
I think it will work
I think it will work
Code: Select all
$s = \Aimeos\MShop::create( $this->context(), 'order' );
$order = \Aimeos\MShop::create( $this->context(), 'order' )->get(2);
$order->setStatusDelivery(2);
$s->save($order);
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Re: Update the order status value
Thanks for your contribution.
The same result.
this is the debug result:
statusdelivery changed but doesn't stored in the database.
The same result.
this is the debug result:
Code: Select all
"order.id" => "2"
"order.baseid" => "2"
"order.siteid" => "1.3."
"order.channel" => ""
"order.datepayment" => "2022-05-24 06:30:54"
"order.datedelivery" => null
"order.statuspayment" => "5"
"order.statusdelivery" => 2
"order.relatedid" => ""
"order.ctime" => "2022-05-24 06:26:32"
"order.mtime" => "2022-05-24 06:30:54"
"order.editor" => "Paul Mcpherson"
".statusdelivery" => "4"
Re: Update the order status value
@marnel is right, you have to call the save() method to store the modified items.
In a multi-site setup, you also need to make sure that the currently used site is the same as the site (siteid) of the item.
In a multi-site setup, you also need to make sure that the currently used site is the same as the site (siteid) of the item.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Re: Update the order status value
thanks @aimeos, thanks @marnel.
It works after changing the context site locale.
It works after changing the context site locale.