View thank you page in order edit in WooCommerce

View thank you page in order edit in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_order_actions', 'wc_show_thank_you_page_order_admin_actions', 9999, 2 );
 
function wc_show_thank_you_page_order_admin_actions( $actions, $order ) {
   if ( $order->has_status( wc_get_is_paid_statuses() ) ) {
      $actions['view_thankyou'] = 'Display thank you page';
   }
   return $actions;
}
 
add_action( 'woocommerce_order_action_view_thankyou', 'wc_redirect_thank_you_page_order_admin_actions' );
 
function wc_redirect_thank_you_page_order_admin_actions( $order ) {
   $url = $order->get_checkout_order_received_url();
   add_filter( 'redirect_post_location', function() use ( $url ) {
      return $url;
   });
}
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.