Home Forums WC Vendors Pro Support Display values from product custom field in emails Reply To: Display values from product custom field in emails

#59425
Anna
Member

Pablo,
There are action hooks within the emails templates that you could use… also you can you can modify the email template to show this information.
The email template you’d need would be: wp content/plugins/wcvendors/templates/emails/vendor-new-order.php

TO use the action hook– look for one in the email. Such as: woocommerce_email_after_order_table
SO if we were to use the product ingredients example still, you could use that hook for the add_action like this:

add_action('woocommerce_email_after_order_table', 'wcv_ingredients_email');
function wcv_ingredients_email() {
    $output = get_post_meta( get_the_ID(), 'wcv_custom_product_ingredients', true );
    echo 'Ingredients: ' . $output . '<br>';
}

Try this– I have not tested it. I think it should work, though. There are other hooks int he email template, such as: woocommerce_email_before_order_table and woocommerce_email_order_meta

This website uses cookies to ensure you get the best experience on our website.