• henrietteklindt

    (@henrietteklindt)


    Hello WordPress/WooCommerce experts

    I’m having a major problem ?? i have trying for days (Google is my friend) to resolve the following issue:

    I have a custom field in products that I have added via php in functions in my child theme: CODE IS HERE
    <? Php
    add_action (‘woocommerce_product_options_general_product_data’, ‘wc_custom_add_custom_fields’);
    function wc_custom_add_custom_fields () {
    // Print a custom text field
    woocommerce_wp_text_input (array (
    ‘id’ => ‘_custom_text_field’,
    ‘label’ => ‘Xtra price field’,
    ‘description’ => ‘This is my custom field.’,
    ‘desc_tip’ => ‘true’,
    ‘placeholder’ => ‘Write my custom note’
    ));
    }
    add_action (‘woocommerce_process_product_meta’, ‘wc_custom_save_custom_fields’);
    function wc_custom_save_custom_fields ($ post_id) {
    if (! empty ($ _POST [‘_ custom_text_field’])) {
    update_post_meta ($ post_id, ‘_custom_text_field’, esc_attr ($ _POST [‘_ custom_text_field’]));
    }

    It will be shown as it should so far so good – but how do the following:

    1) data from custom field shown in email, i′m thinking possibly via shortcode? It should only appear in the custom email I’ve created through the WooCommerce Booster?

    2) How do i insert data into my custom field from a csv file? I have tried this product-import route, but when I get to select ‘map to field’, the custom field i created does not appear in this dropdown list?

    Hope it makes sense and that one of you experts has a solution? or can help me further

    thanx ?? from someone desperate…..

  • The topic ‘Custom fields display in custom email Woocommerce Booste4r’ is closed to new replies.