• Resolved rverboom

    (@rverboom)


    Hi,

    I would like to add the active membership plans from “WooCommerce Memberships” to the invoice/deleverynote using the wcdn_order_info_fields filter hook from the FAQ but without luck.

    Is there anyway you can help me out with this none?

    • This topic was modified 4 years, 7 months ago by rverboom.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Support kenil802

    (@kenil802)

    Hi @rverboom,

    To add the membership plans to the invoice and the delivery note, could you please try adding the below code and check whether it works or not.

    Code:

    
    /**
    * Add this code snippet in functions.php file of your currently active theme.
    * An example that adds a ‘VAT’ and ‘Customer Number’ field to the end of the list.
    */
    function example_custom_order_fields( $fields, $order ) {
    $new_fields = array();
    
    if( get_post_meta( $order->id, ‘your_meta_field_name’, true ) ) {
    $new_fields[‘your_meta_field_name’] = array(
    ‘label’ => ‘VAT’,
    ‘value’ => get_post_meta( $order->id, ‘your_meta_field_name’, true )
    );
    }
    
    if( get_post_meta( $order->id, ‘your_meta_field_name’, true ) ) {
    $new_fields[‘your_meta_field_name’] = array(
    ‘label’ => ‘Customer Number’,
    ‘value’ => get_post_meta( $order->id, ‘your_meta_field_name’, true )
    );
    }
    
    return array_merge( $fields, $new_fields );
    }
    add_filter( ‘wcdn_order_info_fields’, ‘example_custom_order_fields’, 10, 2 );
    

    Also, please make sure that the field itself should be meta-field.

    Please let us know how it goes.

    Regards,
    Kenil Shah

    • This reply was modified 4 years, 6 months ago by Yui.
    • This reply was modified 4 years, 6 months ago by Yui. Reason: please use CODE button for proper formatting
Viewing 1 replies (of 1 total)
  • The topic ‘WooCommerce active membership in deliverynote’ is closed to new replies.