Home Forums WoodMart support forum Cancel order in account settings

Cancel order in account settings

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #490359

    bogdan-4113
    Participant

    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.
    #490732

    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.

    #490988

    bogdan-4113
    Participant

    Hello,

    Where exactly i have to put that code?

    Thx

    #491100

    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.

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)