• Hey,

    So when we print our invoices it would be awesome to have the sales person attached to the account that ordered (they are already entered as a sales person field under each individual user). Is it possible to reference this field and put it on the print out? Thanks in advance for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @particlemarketing,

    Can you please let us know are you using any plugin to add the sales person to your order? If yes, then please let us know the plugin name and the plugin link so that we will check and see if we can add it to our invoice or not.

    Also, can you please share the screenshot of one of your order where the custom field is displayed?

    Regards,
    Priyanka Jagtap

    Hi, Priyanka.

    Is it possible to simply hook into a usermeta field?
    That would be the easiest, I think.

    We are using Paid Memberships Pro’s Registration Helper, and simply set up a custom text field inside a customizations plugin. Here’s how the field is set up:

    		$fields[] = new PMProRH_Field(
    		'field_rep',						// input name, will also be used as meta key
    		'text',							// type of field
    		array(
    			'label'		=> 'Field Rep Assigned to Account'	,		// custom field label
    			'size'		=> 40,				// input size
    			'class'		=> 'field_rep',			// custom class
    			'profile'	=> true,			// show in user profile
    			'required'	=> true,			// make this field required
    			'levels'	=> array(1,3)		// only level 1 & 3 has this field
    			
    		)
    	);	

    Thanks!

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @particlemarketing and @bestslopedesigns,

    Thank you for sharing the code snippet. If you have already created a custom field then you can try adding the method which I have mentioned below in your active theme’s functions.php file. You just need to replace the “custom_text_field_title” with your custom field name.

    function example_custom_order_fields( $fields, $order ) {
        $new_fields = array();
            
        if( get_post_meta( $order->get_ID(), 'custom_text_field_title', true ) ) {
            $new_fields['custom_text_field_title'] = array( 
                'label' => 'Ubicazione',
                'value' => get_post_meta( $order->get_ID(), 'custom_text_field_title', true )
            );
        }
        
        
        return array_merge( $fields, $new_fields );
    }
    add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );
    

    Please check and let us know whether it works for you or not.

    Regards,
    Priyanka Jagtap

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Custom Field to Print Out’ is closed to new replies.