• Resolved vahidlakkal

    (@vahidlakkal)


    Hi friend,
    Is there any way to identify Cash on delivery orders in woo commerce order dashboard? Is there any code or plugin that Displays mode of payment somewhere near every order details? Help Apreciated!

Viewing 5 replies - 1 through 5 (of 5 total)
  • I use:

    
        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;
         }
        }
    

    Either in your child theme’s functions.php or with the Code Snippets plugin: https://www.ads-software.com/plugins/code-snippets/

    Thread Starter vahidlakkal

    (@vahidlakkal)

    It didnt work. iwas getting error
    “Don’t Panic

    The code snippet you are trying to save produced a fatal error on line 1:
    syntax error, unexpected ‘&’

    The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.

    Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.”

    Strange – that’s a copy/paste from my site

    Are the ‘ characters correct? Like in ‘manage_edit-shop_order_columns’

    They’ve not been changed to ` have they?

    Thread Starter vahidlakkal

    (@vahidlakkal)

    I just copy paste. that error came when clicked on save

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @vahidlakkal. There is a code snippet here that you can try. I hope that helps.

    Note that this thread will be resolved in 7 days if there are no new posts.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to identify Cash on Delivery Orders in woocommerce dashboard’ is closed to new replies.