I'm trying to add two buttons to Woocommerce / MyAccount / View Order Details (Not in orders list) (ORDER AGAIN | CANCEL) but I only see the 'Order Again' in completed orders but not in other statuses. Thank you!
function cs_add_order_again_to_my_orders_details( $actions, $order ) {
if ( $order->has_status( array( 'completed','pending', 'processing', 'on-hold', 'failed' ) ) ) {
$actions['order-again'] = array(
'url' => wp_nonce_url( add_query_arg( 'order_again', $order->id ) , 'woocommerce-order_again' ),
'name' => __( 'Order Again', 'woocommerce' )
);
// cancel button
$actions['cancel'] = array(
'url' => NO_IDEA,
'name' => NO_IDEA
);
}
return $actions;
}
add_filter( 'woocommerce_my_account_my_orders_details', 'cs_add_order_again_to_my_orders_details', 50, 2 );