WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Print Invoice & Delivery Note
Adding a customm special field (1 post)

  1. candell
    Member
    Posted 2 months ago #

    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/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.