• Resolved MORETTI Emmanuel

    (@noirdez51)


    Hello,
    Your PlugIn is a great value ??
    I would like add a field in Address.

    I succeed to doo it into ‘info fileds’ with this

    function example_custom_order_fields( $fields, $order ) {
    $new_fields = array();
    if( get_post_meta( $order->id, ‘pickup_location’, true ) ) {
    $new_fields[‘pickup_location’] = array(
    ‘label’ => ‘Site VAE’,
    ‘value’ => get_post_meta( $order->id, ‘pickup_location’, true )
    ); }
    return array_merge( $fields, $new_fields );
    }
    add_filter( ‘wcdn_order_info_fields’, ‘example_custom_order_fields’, 10, 2 );

    But How to do this in “address billing”

    Thanks again for this great plugin
    Bests regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support kenil802

    (@kenil802)

    Hi @noirdez51,

    Apologies for the delay in response.

    Thank you for appreciating our plugin.

    I will need to ask the developer regarding your query. So, I will get back to you once I hear from them.

    Regards,
    Kenil Shah

    Plugin Support kenil802

    (@kenil802)

    Hi @noirdez51,

    Could you please use the below filters to modify the address and to print it with the new field? Filters have 2 params which are
    1. Formatted address ( the address which is currently seen on the invoice )
    2. $order object ( which will be used to add fields )

    So using the filters you can modify your address.
    Filters are:-

    1) wcdn_address_billing:- For billing address
    2) wcdn_address_shipping:- For the shipping address

    Do let us know how it goes.

    Regards,
    Kenil Shah

    • This reply was modified 4 years, 3 months ago by kenil802.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Fields to address’ is closed to new replies.