T
T
twentytvvo2021-02-04 01:07:58
WooCommerce
twentytvvo, 2021-02-04 01:07:58

New order fields are not displayed in the email and admin panel. How to fix?

Field 1, Field 2.... are naturally displayed in the admin panel and the letter, but the value from the form is not pulled up there.
I indicated the correct id. Tell me where I could make a mistake?
(Fields added via plugin)

add_action( 'woocommerce_admin_order_data_after_shipping_address', 'custom_field_display_admin_order_meta', 10, 1 );

function custom_field_display_admin_order_meta($order){
    echo '<p><strong>'.__('Поле 1').':</strong> ' . get_post_meta( $order->id, 'additional_name', true ) . '</p>';
    echo '<p><strong>'.__('Поле 2').':</strong> ' . get_post_meta( $order->id, 'additional_phone', true ) . '</p>';
    echo '<p><strong>'.__('Поле 3').':</strong> ' . get_post_meta( $order->id, 'shipping_otkritka', true ) . '</p>';
    echo '<p><strong>'.__('Поле 4').':</strong> ' . get_post_meta( $order->id, 'shipping_adress', true ) . '</p>';
    echo '<p><strong>'.__('Поле 5').':</strong> ' . get_post_meta( $order->id, 'shipping_date', true ) . '</p>';
    echo '<p><strong>'.__('Поле 6').':</strong> ' . get_post_meta( $order->id, 'shipping_time', true ) . '</p>';
    echo '<p><strong>'.__('Поле 7').':</strong> ' . get_post_meta( $order->id, 'billing_phone', true ) . '</p>';
    echo '<p><strong>'.__('Поле 8').':</strong> ' . get_post_meta( $order->id, 'billing_viber', true ) . '</p>';
    echo '<p><strong>'.__('Поле  9').':</strong> ' . get_post_meta( $order->id, 'billing_whatsapp', true ) . '</p>';
    echo '<p><strong>'.__('Поле  10').':</strong> ' . get_post_meta( $order->id, 'billing_telegram', true ) . '</p>';
    echo '<p><strong>'.__('Поле 11').':</strong> ' . get_post_meta( $order->id, 'billing_first_name', true ) . '</p>';
    echo '<p><strong>'.__('Поле 12').':</strong> ' . get_post_meta( $order->id, 'billing_email', true ) . '</p>';
    echo '<p><strong>'.__('Поле 13').':</strong> ' . get_post_meta( $order->id, 'address_ask', true ) . '</p>';
    echo '<p><strong>'.__('Поле 14').':</strong> ' . get_post_meta( $order->id, 'add_address', true ) . '</p>';
    echo '<p><strong>'.__('Поле 15').':</strong> ' . get_post_meta( $order->id, 'dont_say', true ) . '</p>';
    echo '<p><strong>'.__('Поле  16').':</strong> ' . get_post_meta( $order->id, 'dont_say_who', true ) . '</p>';
    echo '<p><strong>'.__('Поле  17').':</strong> ' . get_post_meta( $order->id, 'without_call', true ) . '</p>';
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2017-08-08
@myaca

zomigi.com/blog/full-width-pinned-layouts-with-flexbox

T
twobomb, 2017-08-08
@twobomb

Use bootstrap or flexbox like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question