Skip to content

Instantly share code, notes, and snippets.

@elias1435
Created February 9, 2024 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elias1435/304e8e491b0eea5e898f4a7ea386b3e8 to your computer and use it in GitHub Desktop.
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"
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