Categories
Development WooCommerce Wordpress

How to display item meta data in email confirmation using woocommerce_order_item_meta_end

Our store sells software and we’re adding a software voucher code to each purchased. Once the purchase is completed (via the woocommerce_payment_complete hook) we generate the voucher code and add it to each item purchased via wc_add_order_item_meta method. Summarized code: add_filter(‘woocommerce_payment_complete’, ‘add_voucher_code’); function add_voucher_code( $order_id ) { $order = new WC_Order( $order_id ); $items = […]