We're trying to implement the option to request an order cancelation from the vendor panel in the view orders page. The idea is to rely on order status change : when the vendor clicks on the request cancelation button, the order status changes to await cancelation status â€¦ in the admin panel, we add an order tab in the moderation menu, that page will only display the orders with the await cancelation status, the admin can either approve the cancelation or deny it, both actions will also change the order status: Cancelled if approved or previous status before cancelation request if denied.
Now the question is : After adding the button like shown below in design/backend/templates/views/orders/manage.tpl
I have a followup question regarding this feature, as I mentioned the idea is that the admin can see a list contains the orders that the vendor requested to be deleted.
I created an add-on to add the Request deletion item in the vendor's menu as shown in the screenshot, I created a new .tpl file called cancellation in the design/backend/templates/ views/orders/cancellation.tpl
Can you suggest an idea on how to filter the orders, I need to show the ones with the new status that I created ?
In the cancellation.tpl, I tried copying the design/backend/templates/ views/orders/manage.tpl just to check if I can reach the orders data but it's show the page with no data available.
You should also call fn_get_orders function ( check in the app/controllers/backend/orders.php file). You can also add the status parameter to it to receive order with specific order status only
Thanks for the input, I can't get the orders data using the same logic in design/backend/templates/views/orders/manage.tpl â€¦ You can see that I debugged the $orders variable in the design/backend/templates/views/orders/cancellation.tpl, but I get nothing.
I mean the links where you click on the order ID or customer name to check the details, we decided to keep them since the admin needs to check the order's details before approving or denying the cancellation.
I'm currently trying to find a way to block the vendor from requesting cancellation if the cancellation was denied once by the admin.
I could also improve the UI like shown in the second screenshot using the thumbs up and down.