Created
February 9, 2024 15:34
-
-
Save elias1435/304e8e491b0eea5e898f4a7ea386b3e8 to your computer and use it in GitHub Desktop.
ACF data in order received page woocommerce. ACF field name is "course_date"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action ('woocommerce_order_details_after_order_table', 'action_order_details_after_order_table', 20 ); | |
function action_order_details_after_order_table($order) { | |
foreach ( $order->get_items() as $item ) { | |
if ( $course_date = get_field('course_date', $item->get_product_id())) { | |
printf('<p class="course-date">%s: %s<p>', __("Course Date "), $course_date); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment