• Resolved paulcobb

    (@paulcobb)


    I like the new summary order page in the latest version.
    The issue I have is that I don’t have visibility now on ‘payment via’ (although this is visible by mousing over the total for the line item) and when gfaced with multiple pages of orders awaiting completion it is somewhat of a issue having to interogate each one to establish the payment type.
    Would it be possible to allow customisation of the summeary page to include/exclude the now missing items?
    Thanks,
    Paul

Viewing 5 replies - 1 through 5 (of 5 total)
  • // WooCommerce - Add payment method column to shop order table
    // since v3.3
     
    add_filter( 'manage_shop_order_posts_columns', 'set_shop_order_posts_columns', 99 );
    function set_shop_order_posts_columns( $columns ) {
      $columns['payment_method'] = 'Payment<br>Method';
      return $columns;
    }
    
    add_action( 'manage_shop_order_posts_custom_column' , 'show_custom_columns', 10, 2 );
    function show_custom_columns( $column_name, $post_id ) {
      switch ( $column_name ) {
        case 'payment_method':
          $order = new WC_Order( $post_id );
          print $order->get_payment_method();
          break;
      }
    }

    The code can go in functions.php for your child theme or you can add it using the “My Custom Functions” plugin.

    Thread Starter paulcobb

    (@paulcobb)

    Thanks!
    Seems to give me white screen when applied though

    Thread Starter paulcobb

    (@paulcobb)

    My apologies – works fine!
    It was a copy/paste issue.
    Many thanks ??

    Um… Works for me and the code validates. Check you have not changed any straight quotes to smart quotes. Maybe something in your setup is using the same function names. Try renaming the functions, so:

    add_filter( 'manage_shop_order_posts_columns', 'set_wc_shop_order_posts_columns', 99 );
    function set_wc_shop_order_posts_columns( $columns ) {
      $columns['payment_method'] = 'Payment<br>Method';
      return $columns;
    }
    
    add_action( 'manage_shop_order_posts_custom_column' , 'show_wc_custom_columns', 10, 2 );
    function show_wc_custom_columns( $column_name, $post_id ) {
      switch ( $column_name ) {
        case 'payment_method':
          $order = new WC_Order( $post_id );
          print $order->get_payment_method();
          break;
      }
    }

    Good! I think there might be a market for restoring lost shop order columns.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Order summary page customisation?’ is closed to new replies.