• Resolved sdgfasd

    (@sdgfasd)


    Hi there,
    How can I place a cancelation button for orders, so that the customer can cancel the order just he/she has created.
    thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Add this snippet to your for the purpose-

    add_filter( 'woocommerce_valid_order_statuses_for_cancel', 'custom_valid_order_statuses_for_cancel', 10, 1 );
    function custom_valid_order_statuses_for_cancel( $statuses ){
      return array_merge( $statuses, array( 'processing', 'on-hold' ) );
    }

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin – https://wordpress.org/plugins/code-snippets/

    Thank You

Viewing 1 replies (of 1 total)

The topic ‘cancelation button for orders’ is closed to new replies.