WooCommerce Code Correction

Dokončeno Zveřejněno před 6 lety K zaplacení v momentě doručení
Dokončeno K zaplacení v momentě doručení

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

Identifikační číslo projektu: #15891040

O projektu

6 nabídek Projekt na dálku Aktivní před 6 lety

Uděleno uživateli:

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 Další

₹950 INR za 0 dní
(10 recenzí)
3.2

6 Freelnceři na tento projekt zveřejňují nabídky v průměru ₹3778

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 Další

₹2050 INR za 1 den
(9 Recenzí)
3.8
patidarkavita489

A proposal has not yet been provided

₹1100 INR za 5 dní
(3 Recenzí)
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. Další

₹1250 INR za 1 den
(3 Recenzí)
1.7
beingidea

A proposal has not yet been provided

₹650 INR za 1 den
(1 recenze)
0.0