How to add Order Again button to WooCommerce My Account / Previous Orders page

TIPS

May 22, 2019 | WooCommerce Tips | 1 comment

Add the function below to your child theme functions.php file. [php] /** * Add order again button in my orders actions. * * @param array $actions * @param WC_Order $order * @return array */ function cs_add_order_again_to_my_orders_actions( $actions, $order ) { if ( $order->has_status( ‘completed’ ) ) { $actions[‘order-again’] = array( ‘url’ => wp_nonce_url( add_query_arg( ‘order_again’, $order->id ) , ‘woocommerce-order_again’ ), ‘name’ => __( ‘Order Again’, ‘woocommerce’ ) ); } return $actions; } add_filter( ‘woocommerce_my_account_my_orders_actions’, ‘cs_add_order_again_to_my_orders_actions’, 50, 2 ); [/php]

1 Comment

  1. Hwo to add Review button on every completed order in my account section in woocommerce.

    Reply

Submit a Comment

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

More Tips

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.

Cloudways Hosting

WPEngine Hosting

Pressable Hosting

AccuWeb Hosting

Ask the Divi Guy a Question

"*" indicates required fields