Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpf_product_meta_fields( $fields ) {
- $fields['course_date'] = array( 'label' => 'Course Date', 'type' => 'date', 'group' => 'woocommerce' );
- return $fields;
- }
- add_filter( 'wpf_meta_fields', 'wpf_product_meta_fields' );
- function get_product_data( $order_data, $order ) {
- foreach ( $order->get_items() as $item ) {
- $product_id = $item->get_product_id();
- $meta_value = get_post_meta( $product_id, 'acls-p-course-date-a', true );
- if ( ! empty( $meta_value ) ) {
- $order_data['course_date'] = $meta_value;
- }
- }
- return $order_data;
- }
- add_filter( 'wpf_woocommerce_customer_data', 'get_product_data', 10, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement