• 1. I want to seperate column for order id and customer name in vendor login order list and also in excel.
    2. or I have a woocommerce booking plugin so can we show person detail(like 1, adult, 1 child) in report.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter testpaid2322

    (@testpaid2322)

    Reply awaited.
    I have also WooCommerce Frontend Manager – Ultimate paid plugin..

    Plugin Author WC Lovers

    (@wclovers)

    1. I want to seperate column for order id and customer name in vendor login order list and also in excel.

    – Add this snippet to your site –

    add_filter( 'wcfm_orders_additional_info_column_label', function( $add_label ) {
    	$add_label = 'Customer';
      return $add_label;
    });
    add_filter( 'wcfm_orders_additonal_data', function( $customer_note, $order_id ) {
      global $WCFM, $WCFMmp, $wpdb;
      $the_order = wc_get_order( $order_id );
      $customer = trim( sprintf( _x( '%1$s %2$s', 'full name', 'wc-frontend-manager' ), $the_order->get_billing_first_name(), $the_order->get_billing_last_name() ) );
    	return $customer;
    }, 50, 2 );
    add_filter( 'wcfm_orders_additonal_data_hidden', '__return_false' );

    2. or I have a woocommerce booking plugin so can we show person detail(like 1, adult, 1 child) in report.

    – DO you want to add “Persons” column to Booking list page? If so, add this snippet to your site –

    add_filter( 'wcfm_bookings_additonal_data', function( $content, $booking_id, $order_number ) {
    	$booking = new WC_Booking( $booking_id );
    	$product_id        = $booking->get_product_id( 'edit' );
    	$product           = $booking->get_product( $product_id );
    	if ( $product && is_callable( array( $product, 'get_person_types' ) ) ) {
    		$person_types  = $product ? $product->get_person_types() : array();
    		$person_counts = $booking->get_person_counts();
    		
    		if ( count( $person_counts ) > 0 || count( $person_types ) > 0 ) {
    			$content = count( $person_counts );
    			foreach ( $person_counts as $person_id => $person_count ) {
    				$person_type = null;
    
    				try {
    					$person_type = new WC_Product_Booking_Person_Type( $person_id );
    				} catch ( Exception $e ) {
    				}
    
    				if ( $person_type ) {
    					$content .= '<br />';
    					$content .= $person_type->get_name() . ' (';
    					$content .= $person_count;
    					$content .= ')';
    				}
    			} 
    		} else {
    			$content = ! empty( $person_counts[0] ) ? $person_counts[0] : 0;
    		}
    	}
    	return $content;
    }, 50, 3 );
    add_filter( 'wcfm_bookings_additional_info_column_label', function( $label ) {
    	return 'Person(s)';	
    });
    add_filter( 'wcfm_bookings_additonal_data_hidden', '__return_false' );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin –?https://www.ads-software.com/plugins/code-snippets/

    Thread Starter testpaid2322

    (@testpaid2322)

    i have added both hooks in code snippets but not able to see seprate columns for order id or person type column..
    https://ibb.co/s3Kf6hq

    • This reply was modified 4 years, 1 month ago by testpaid2322.
    Plugin Author WC Lovers

    (@wclovers)

    Person type column added under “bookings list”, not under “orders list”

    Thread Starter testpaid2322

    (@testpaid2322)

    1. I check on booking list also but not seeing any person column.please find screenshot.
    https://ibb.co/r6pVM3n
    2. can we remove name in order id column.
    https://ibb.co/wc6wsqV

    • This reply was modified 4 years, 1 month ago by testpaid2322.
    Plugin Author WC Lovers

    (@wclovers)

    2. can we remove name in order id column.
    https://ibb.co/wc6wsqV

    – Use this snippet for the purpose-

    add_filter( 'wcfm_order_label_display', function( $order_label, $order_id, $product_id, $vendor_order, $username ) {
    	if( function_exists( 'get_wcfm_view_order_url' ) ) {
    		$the_order = wc_get_order( $order_id );
    		$order_label = '<a href="' . get_wcfm_view_order_url( $order_id ) . '" class="wcfm_order_title">#' . esc_attr( $the_order->get_order_number() ). '</a>';
    	}
    	return $order_label;
    }, 50, 5 );
    Thread Starter testpaid2322

    (@testpaid2322)

    what about point 1.?
    or can we use same snippets for seprating booking id in booking list.??

    • This reply was modified 4 years, 1 month ago by testpaid2322.
    Thread Starter testpaid2322

    (@testpaid2322)

    Waiting for your revert.

    Plugin Author WC Lovers

    (@wclovers)

    or can we use same snippets for seprating booking id in booking list.??

    – NO.

    That snippet is fine, working perfectly in my environment – https://ibb.co/g3WLSMZ

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Order Report’ is closed to new replies.