• Resolved beginwithwp

    (@beginwithwp)


    Hi,

    Can you help me?
    I’ve added billing_address_3 and shipping_address_3. And I’ve checked on ‘Display in Emails’ and ‘Display in Order Detail Pages’.
    If I order a product, I recieve a mail with ‘added billing_address_3 and shipping_address_3’ on ‘Display in Order Detail Pages’.
    But there is no billing_address_3 in billing adress on left under ‘Display in Order Detail Pages’ and there is no shipping_address_3 on right side of the mail under ‘Display in Order Detail Pages’.

    In short, i want to see shipping_address_3 next to shipping_address_2 and
    billing_address_3 next to billing_address_2.
    What do i have to do?

    Thank you in advance!!!

    https://wordpress.org/plugins/woo-checkout-field-editor-pro/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    Hi,

    Thank you for contacting us,

    In short, custom fields will always display in predefined positions in both Order Details Page and Order Email.

    In Order Details page, all custom fields will always be displayed along with ‘Customer Details’. And in Order Email, all custom fields will always be displayed just before ‘Your details’ section.

    I hope I understood you question properly. Let us know in case you need more details.

    Thanks,
    Support-ThemeHigh

    Thread Starter beginwithwp

    (@beginwithwp)

    Hi Support-ThemeHigh,

    Thank you for answering my question.
    Is there any method that I can put billing_address_3 in “billing adress” section in the email?

    I tried like this in function.php of my child theme:
    add_filter( ‘woocommerce_order_formatted_billing_address’ , ‘my_default_address_fields’ );
    function my_default_address_fields( $fields ) {
    $fields2[‘address_1’] = $fields[‘billing_address_1’];
    $fields2[‘address_2’] = $fields[‘billing_address_2’];
    $fields2[‘address_3’] = $fields[‘billing_address_3’];

    return $fields2;
    }

    But it doesn’t work. And I cannot find any solution on internet.
    Can you please help me?

    Thanks!!!

    Plugin Author ThemeHigh

    (@themehigh)

    Hi,

    I hope the below code will help you,

    add_filter( ‘woocommerce_order_formatted_billing_address’ , ‘my_default_address_fields’, 10,2 );
    function my_default_address_fields( $fields, $order ) {
    $address_3 = get_post_meta( $order->id, ‘billing_address_3’, true ); // use your custom field name here(ex: billing_address_3)
    $fields[‘address_3’] = $address_3;

    return $fields;
    }

    add_filter( ‘woocommerce_formatted_address_replacements’, ‘add_new_replacement_fields’,10,2 );
    function add_new_replacement_fields( $replacements, $address ) {
    $replacements[‘{address_3}’] = isset($address[‘address_3’]) ? $address[‘address_3’] : ”;
    return $replacements;
    }

    add_filter( ‘woocommerce_localisation_address_formats’, ‘my_address_formats’ );
    function my_address_formats( $formats ) {
    // Rearrange these fields how you need, each country has an entry in the array like this:
    $formats[‘IN’] = “{name}\n{company}\n{address_1}\n{address_2}\n{address_3}\n{city}, {state} {postcode}\n{country}”;

    return $formats;
    }

    Thanks,
    Support-ThemeHigh

    Thread Starter beginwithwp

    (@beginwithwp)

    Hi Support-ThemeHigh,

    Million times thank you
    This is exactly what i needed. And it works perfectly.

    Thanks!!!

    Plugin Author ThemeHigh

    (@themehigh)

    Glad to hear that it worked for you!

    We take this opportunity to request you to give your valuable review if you like our plugin.

    I am closing this thread, please let us know in case you have any issue with our plugin.

    Thanks,
    Support-ThemeHigh

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘billing/shipping address extra’ is closed to new replies.