How to hide order number order loop woocommerce admin - order loop

How to hide order number order loop woocommerce admin – order loop

How to hide order number order loop woocommerce admin – order loop

The WooCommerce order loop refers to a programming concept used in WordPress and the WooCommerce plugin. WooCommerce is a popular e-commerce platform built on top of WordPress, allowing users to create and manage online stores.In this we learn How to hide order number order loop woocommerce admin – order loop

In the context of WooCommerce, the order loop is a structure or code block that helps retrieve and display order information on the frontend. It typically runs within a WordPress template file, such as the archive-order.php file. In this you learn to Hide order number from order loop woocommerce admin

How to hide order number order loop woocommerce admin - order loop

If you want to hide order number from order loop admin order pages list you have to do two steps :

Remove exist order column

To remove already exist column from order page you have to use a hook of woocommerce of wordpress

to remove the exist column you have to use this hook of code which as shown in below –

function modify_order_columns( $columns ) {
    unset( $columns[‘order_number’] );
    return $columns;
}
add_filter( ‘manage_edit-shop_order_columns’, ‘modify_order_columns’, 20 );
Remove exist order column

Add custom column to order page

Add custom column to order page without order number just show the order user first name and last name. For do this you need to apply a hook named manage_shop_order_posts_custom_column this hook is give to permission to customize the order loop page of woocommerce. You can apply the code like this :

add_action( ‘manage_shop_order_posts_custom_column’, ‘add_content_to_custom_column’ );
function add_content_to_custom_column( $column ) {
    global $post;
    if ( ‘order_title’ === $column ) {
        $order = wc_get_order( $post->ID );
        $billing_first_name = $order->get_billing_first_name();
        $billing_last_name = $order->get_billing_last_name();
        echo ‘<a href=”‘ . admin_url( ‘post.php?post=’ . $post->ID . ‘&action=edit’ ) . ‘”><strong>’ . $billing_first_name .’ ‘. $billing_last_name . ‘</strong></a>’;
    }
}
In this hook first of to assign new custom column to order loop and after that give to data to custom column without order number.
Add custom column to order page
How to hide order number order loop woocommerce admin – order loop

FaQ

What is order ID and order number?

Order ID: The order ID is an internal identifier used by the WooCommerce system to uniquely identify each order.

How do I view my order history in WooCommerce?

Once logged in, you’ll be on the WordPress admin dashboard. Look for the “WooCommerce” tab on the left-hand side menu and click on it.In the WooCommerce submenu, click on “Orders.” This will take you to the WooCommerce Orders page, where you can view your order history.

One comment

  1. Hi there, I just came across your new site and saw that you’re getting started with WordPress – something I’m well experienced in! It’s always thrilling to see how new websites unfold. Building a website is not always a simple task – are you doing this on your own or do you have a developer to help you out? Regardless, I can’t wait to see how your site progresses. If you ever need to discuss anything WordPress-related, feel free to drop me an email at contact@ghazni.me, or message me on WhatsApp.

    Kind regards,
    Mahmud Ghazni
    WordPress Expert
    WhatsApp: +880 1322-311024

Leave a Reply

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