Hi,
I have gotten the WooCommerce Extension “Checkout Field Editor” and I like to get these fields into the order emails.
I have added into my vantage child php file below code, but something wrong.
[/code]
<?php
/**
* Enqueue the parent theme stylesheet.
*/
add_action( 'wp_enqueue_scripts', 'vantage_parent_style' );
function vantage_parent_style() {
wp_enqueue_style( 'parent-theme', get_template_directory_uri() . '/style.css' );
}
/**
* Enqueue the child theme stylesheet.
*/
add_action( 'wp_enqueue_scripts', 'vantage_child_style', 20 );
function vantage_child_style() {
wp_enqueue_style( 'child-theme', get_stylesheet_uri() );
}
/**
* Set the child theme text domain.
*/
function vantage_child_set_text_domain(){
load_theme_textdomain( 'vantage', get_stylesheet_directory() . '/languages' );
}
add_action('after_setup_theme', 'vantage_child_set_text_domain', 15);
/**
* Add the field to order emails
**/
add_filter('woocommerce_email_order_meta_keys', 'my_woocommerce_email_order_meta_keys');
function my_woocommerce_email_order_meta_keys( $keys ) {
$keys['postnummer'] = 'Postnummer';
$keys['personnummer'] = 'Personnummer';
$keys['telefon_2'] = 'Telefon 2';
$keys['postnummer_leveransadress'] = 'Postnummer leveransadress';
$keys['ort_leveransadress'] = 'Ort leveransadress';
$keys['fastighetsbeteckning'] = 'Fastighetsbeteckning';
return $keys;
}
Can you help me checking whats wrong?
Best regards
Eric
<?php
/**
* Enqueue the parent theme stylesheet.
*/
add_action( 'wp_enqueue_scripts', 'vantage_parent_style' );
function vantage_parent_style() {
wp_enqueue_style( 'parent-theme', get_template_directory_uri() . '/style.css' );
}
/**
* Enqueue the child theme stylesheet.
*/
add_action( 'wp_enqueue_scripts', 'vantage_child_style', 20 );
function vantage_child_style() {
wp_enqueue_style( 'child-theme', get_stylesheet_uri() );
}
/**
* Set the child theme text domain.
*/
function vantage_child_set_text_domain(){
load_theme_textdomain( 'vantage', get_stylesheet_directory() . '/languages' );
}
add_action('after_setup_theme', 'vantage_child_set_text_domain', 15);
/**
* Add the field to order emails
**/
add_filter('woocommerce_email_order_meta_keys', 'my_woocommerce_email_order_meta_keys');
function my_woocommerce_email_order_meta_keys( $keys ) {
$keys['postnummer'] = 'Postnummer';
$keys['personnummer'] = 'Personnummer';
$keys['telefon_2'] = 'Telefon 2';
$keys['postnummer_leveransadress'] = 'Postnummer leveransadress';
$keys['ort_leveransadress'] = 'Ort leveransadress';
$keys['fastighetsbeteckning'] = 'Fastighetsbeteckning';
return $keys;
}
Hi Eric
Thanks for your email. I’ll respond there shorlty.