Hi John,
Thank you so much for your kind reply, but unfortunately it doesn’t work.
Here’s my final code block:
$tour_start_date = get_field(‘tour_start_date’, $item->get_product_id());
if ($tour_start_date) {
echo ‘<p>’ . esc_html($tour_start_date) . ‘</p>’;
}
https://drive.google.com/file/d/1YNShRXEoQQ4ACnRHBE8rYcXhOf0kdcHx/view?usp=sharing
https://drive.google.com/file/d/1YJMmjoqz6p0vIorrQFbWTEq3Uzjnz2Br/view?usp=sharing
Did I miss something?
Hi John,
Thank you so much for your kind reply, but unfortunately it doesn’t work.
Here’s my final code block:
$tour_start_date = get_field(‘tour_start_date’, $item->get_product_id());
if ($tour_start_date) {
echo ‘<p>’ . esc_html($tour_start_date) . ‘</p>’;
}
https://drive.google.com/file/d/1YNShRXEoQQ4ACnRHBE8rYcXhOf0kdcHx/view?usp=sharing
https://drive.google.com/file/d/1YJMmjoqz6p0vIorrQFbWTEq3Uzjnz2Br/view?usp=sharing
https://drive.google.com/file/d/1YKIUFwV7x-bhcf041aL5vZZ6HnPcqWQX/view?usp=sharing
https://drive.google.com/file/d/1YJrxKaEKjtQ0pJOxnG_0n33H6TgVKczg/view?usp=sharing
Did I miss something?
Thank you Rémi.
I don’t use ACF on products when they are added to the cart, on the regular checkout page, etc. I only use ACF on the Admin order page (Orders > Add new order).
This code seems to be for those who use ACF on the product pages and would like to display them everywhere.
Hi John!
Thank you so much for your feedback.
This worked as expected:
$acf_field_name = get_field('acf_field_name', $item->get_order_id());
Here are all the screenshots:
https://drive.google.com/drive/folders/1XfojstMOTl_nCTYLqeGpvW3bDFxQ9B3C?usp=sharing
Hi John,
Thank you so much for your reply. But unfortunately it doesn’t work 🙁
https://drive.google.com/file/d/1YJrxKaEKjtQ0pJOxnG_0n33H6TgVKczg/view?usp=sharing
Did I miss something?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.