Cancel order in account settings
-
Hello there,
I want to add a cancel order button in my account->order status, but i don`t know how. May you help me?
Thx
Attachments:
You must be
logged in to view attached files.
Hello,
Try to add the below code to the functions.php file in your child theme.
add_filter('woocommerce_valid_order_statuses_for_cancel', 'my_cancellable_statuses', 10, 2);
function my_cancellable_statuses($statuses, $order){
return array('pending', 'processing', 'on-hold');
}
Best Regards.
Hello,
Where exactly i have to put that code?
Thx
Hello,
From the dashboard, go to “Appearance” and then click on “Theme Editor.”
Click on the functions.php file to open it in the code editor.
Inside the code editor, add your code snippet:
After adding your code, click the “Update File” button to save your changes.
Best Regards.