• Hi

    I am adding a custom special field to the checkout using the code from http://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/#section-4.

    How do I make this print on print-delivery-note.php?

    Here’s what I have done

    on woocommerce-delivery-notes.php added after the wcdn_get_shipping_notes function

    /**
     * Return has custom message
     */
    if ( !function_exists( 'wcdn_get_message' ) ) {
    	function wcdn_get_message() {
    		global $wcdn;
    		return wpautop( wptexturize( $wcdn->print->get_order()->my_field_name ) );
    	}
    }
    
    /**
     * Show custom message
     */
    if ( !function_exists( 'wcdn_message' ) ) {
    	function wcdn_message() {
    		global $wcdn;
    		echo wcdn_get_message();
    	}
    }

    which is a copy of the shipping notes function with a few changes. I then on print-delivery-note.php have

    <?php wcdn_message(); ?>

    I feel like I am close, I just can’t manage to grab my_field_name and print it to the delivery note.

    Can you help?

    https://wordpress.org/plugins/woocommerce-delivery-notes/

  • The topic ‘Adding a customm special field’ is closed to new replies.