WooCommerce Code Correction

Finalizat Postat la acum 6 ani S-au achitat serviciile după ce au fost prestate
Finalizat S-au achitat serviciile după ce au fost prestate

I have defined two custom fields for my Woocommerce orders using WooCommerce Admin Custom Order Fields extension to create these.

When I manually create an order (/wp-admin/[login to view URL]), I can see those fields and I can successfully add data and save the order.

I have chosen "Show in my Order/Emails" in attributes of WooCommerce Admin Custom Order Fields extension and these fields are appearing in view order page of each orders at front end.

I would, however, also like to have these fields appear as columns in order detail page at /orders/ endpoint where tabular summary of all orders is shown.

Documentation of this extension "WooCommerce Admin Custom Order Fields" tells me that I can use something like get_post_meta($post_id, '_wc_acof_2') with 2 being the ID of that custom field. Have used several ways to achieve result, however, with no luck.

Here is the code I tried in [login to view URL]:

add_action( 'woocommerce_order_details_after_order_table', 'admin_custom_order_field', 10, 1 );

function admin_custom_order_field($order){

echo '<p><strong>'.__('Candidate Name').':</strong> ' . get_post_meta( $order->id, '_wc_acof_1', true ). '</p>';

echo '<p><strong>'.__('Case Due Date').':</strong> ' . get_post_meta( $order->id, '_wc_acof_2', true ). '</p>';

}

WooCommerce WordPress

ID Proiect: #15891040

Detalii despre proiect

6 propuneri Proiect la distanță Activ acum 6 ani

Acordat lui:

phpdevelopers020

Greetings! My name is Amit Kumar and I am an expert in web development. I believe my skills are good enough to match your project. I have a good grasp of working with core php, wordpress and framework Relevant Skills Mai multe

%selectedBids___i_sum_sub_7%%project_currencyDetails_sign_sub_8% INR în 0 zile
(10 Recenzii)
3.2

6 freelanceri plasează o ofertă medie de 3778₹ pentru proiect

oliviainfotech

Hi greetings of the day I am a Experienced PHP Developer based out in Chennai,India. My experience revolves around development of web and mobile applications,Ecommerce websites. Relevant Skills and Experience I believ Mai multe

₹2050 INR în 1 zi
(9 recenzii)
3.8
patidarkavita489

A proposal has not yet been provided

₹1100 INR în 5 zile
(3 recenzii)
2.3
ruchimaniar07

Hello I am Ruchi Maniar wordpress developer since 2.5+ years. I will manage your problem after see the actual code. I may conflict with your other plugins. I have enough experience to solve this problem easily. Mai multe

₹1250 INR în 1 zi
(3 recenzii)
1.7
beingidea

A proposal has not yet been provided

₹650 INR în 1 zi
(1 părere)
0.0