function of custom fields to the emails doesn’t works
-
Hey guys, I try to put into my function.php the code you said to use at this page to see custom field also into email. I replaced meta_key with mine but it doesn’t works anyways.
I have seen looking on the net that it is also a problem of other users, can you tell me what is the solution and update the documentation?This is my function:
add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 ); function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) { $fields['codicefiscale'] = array( 'label' => __( 'Codice fiscale' ), 'value' => get_post_meta( $order->id, 'codicefiscale', true ), ); $fields['partitaiva'] = array( 'label' => __( 'P. IVA' ), 'value' => get_post_meta( $order->id, 'partitaiva', true ), ); $fields['indirizzopec'] = array( 'label' => __( 'PEC' ), 'value' => get_post_meta( $order->id, 'indirizzopec', true ), ); $fields['codiceunivoco'] = array( 'label' => __( 'Codice univoco' ), 'value' => get_post_meta( $order->id, 'codiceunivoco', true ), ); return $fields; }
Thankyou very much,
Alex
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘function of custom fields to the emails doesn’t works’ is closed to new replies.