Skip to content
Advertisement

Add and display custom cart item data in WooCommerce orders and emails

I have a custom woocommerce product type called lottery. I needed a custom select field on it (because it’s not a variable product) So I added one.

Everything is working nice i’m getting the value in the cart and in the checkout too, but I cannot get the value in the admin order or in the order mails (clients and admin).

Here is the code that I added in function.php. What am I doing wrong?

JavaScript

Advertisement

Answer

There are some mistakes in your last function… Instead replace it with the following:

JavaScript

Tested and works. Now your custom field will be displayed on orders and email notifications.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement