• Resolved rondelrob

    (@rondelrob)


    The completion button in the orders list appears to be missing when the status is on one that I have created?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @rondelrob,

    You are correct. I’ve just checked the WooCommerce code, and it looks like “Complete” action is only displayed for pending, on-hold and processing status orders. I will have to make changes in our plugin to include our custom statuses as well.

    Plugin Author Algoritmika

    (@algoritmika)

    @rondelrob,

    Update: if you are ok with adding a small PHP snippet, you can add this code to your (child) theme’s functions.php file:

    
    add_filter( 'woocommerce_admin_order_actions', 'my_alg_wc_order_status_add_complete_action', 10, 2 );
    if ( ! function_exists( 'my_alg_wc_order_status_add_complete_action' ) ) {
        /**
         * my_alg_wc_order_status_add_complete_action.
         */
        function my_alg_wc_order_status_add_complete_action( $actions, $order ) {
            if ( ! isset( $actions['complete'] ) ) {
                if ( $order->has_status( array( 'confirmed', 'shipped' ) ) ) { // TODO: you need to list your custom status slugs here (without the wc- prefix)
                    $actions['complete'] = array(
                        'url'    => wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=completed&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' ),
                        'name'   => __( 'Complete', 'woocommerce' ),
                        'action' => 'complete',
                    );
                }
            }
            return $actions;
        }
    }
    

    Hope that helps. Let me know if you have any questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Complete button’ is closed to new replies.