How to add “Order again” button on WooCommerce my account page

How to add “Order again” button on WooCommerce my account page

This is a very good effective part to add the “Order Again” option on WooCommerce my account page. When you click on the order tab, you can see the “View” button in the placed order table.

You can add an additional button called “Order Again” that can increase sell 30% and make the profit high.


add_filter( 'woocommerce_my_account_my_orders_actions', 'sefatun_order_again_action', 9999, 2 );
    
function sefatun_order_again_action( $actions, $order ) {
    if ( $order->has_status( 'completed' ) ) {
        $actions['order-again'] = array(
            'url' => wp_nonce_url( add_query_arg( 'order_again', $order->get_id(), wc_get_cart_url() ), 'woocommerce-order_again' ),
            'name' => __( 'Order again', 'woocommerce' ),
        );
    }
    return $actions;
}


Code goes to function.php of your active or child theme. Also,  you can use Code Snippet WordPress plugin.

7 Comments

  1. you are in reality a just right webmaster The site loading velocity is incredible It seems that you are doing any unique trick In addition The contents are masterwork you have performed a wonderful task on this topic

  2. I loved as much as youll receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get bought an nervousness over that you wish be delivering the following unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike

  3. you are in reality a good webmaster The website loading velocity is amazing It sort of feels that youre doing any distinctive trick Also The contents are masterwork you have done a fantastic job in this topic

  4. Simply desire to say your article is as surprising The clearness in your post is simply excellent and i could assume you are an expert on this subject Fine with your permission let me to grab your feed to keep up to date with forthcoming post Thanks a million and please carry on the gratifying work

  5. you are truly a just right webmaster The site loading speed is incredible It kind of feels that youre doing any distinctive trick In addition The contents are masterwork you have done a great activity in this matter

Leave a Reply

Your email address will not be published. Required fields are marked *