• Resolved schero86

    (@schero86)


    Hello,
    
    I have been using this custom snippet to display payment method in orders list.
    
    After switching to HPOS this no longer works.
    Can anybody please help?
    
    add_filter( 'manage_edit-shop_order_columns', 'add_payment_method_column', 20 );
    function add_payment_method_column( $columns ) {
    $new_columns = array();
    
    foreach ( $columns as $column_name => $column_info ) {
    
    $new_columns[ $column_name ] = $column_info;
    
    if ( 'order_total' === $column_name ) {
    $new_columns['order_payment'] = __( 'Payment method', 'my-textdomain' );
    }
    }
    
    return $new_columns;
    }
    
    add_action( 'manage_shop_order_posts_custom_column', 'add_payment_method_column_content' );
    function add_payment_method_column_content( $column ) {
    global $post;
    
    if ( 'order_payment' === $column ) {
    
    $order = wc_get_order( $post->ID );
    echo $order->payment_method_title;
    }
    }
    
    
    
    • This topic was modified 1 year, 4 months ago by schero86.
Viewing 1 replies (of 1 total)
  • Hi @schero86

    Thanks for reaching out!

    I have been using this custom snippet to display payment method in orders list.

    I understand the custom snippet above is not working anymore after you enabled HPOS on your site, correct?

    This is a bit of a complicated topic that would need some customization to address. Unfortunately, custom coding is not something we can assist with directly. However, I’ll keep this thread open for a bit to see if anyone from the community can lend a hand.

    If you have any other questions related to development or custom coding, don’t hesitate to reach out to some of the great resources we have available for support. The WooCommerce community is filled with talented open-source developers, and many of them are active on the channels listed below:

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘Payment method in woocommerce order list’ is closed to new replies.