Change order status directly from a link on the email merchant

Hi :slight_smile:

I want to add a link on the mail sent to the merchant after each order, which change the status to the next step.
On the order-to-merchant.twig file, we have this (as we can find it on the backoffice) :

 <a href="{{ config.site_url }}{{ admin_url('order', { order: order.id }) }}">{{ lex('commerce.email.order_rcvdmerch.view_order_in_manager') }}</a>

I wanted to add a link like this :

https://website.com/manager/?namespace=commerce&a=index&ca=order/set_status&order=22&id=2

I don’t find documentation about available parameters for the function admin_url.
A have tried :

 <a href="{{ config.site_url }}{{ admin_url('order/set_status', { order: order.id }) }}">

but obviously it doesn’t work !

admin_url supports the action (order/set_status) and the query parameters to add in object format. So you’ll need to provide the order and status change ID.

1 Like

Thanks Mark, I get it :

{{ config.site_url }}{{ admin_url('order/set_status', { order: order.id, id: 2 }) }}
1 Like