Support

Account

Home Forums General Issues Add Field to invoice attachment Reply To: Add Field to invoice attachment

  • HI @yett

    I think you would need to add the field to the order not the product.

    You then need to add the code to the emails:

    
    /**
     * Add a custom field (in an order) to the emails
     */
    add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 );
    
    function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
        $fields['Begindatum'] = array(
            'label' => __( 'Begin Datum' ),
            'value' => get_post_meta( $order->id, 'Begindatum', true ),
        );
        return $fields;
    }
    

    If you’re using a plugin for the invoices, you may need to check if they have any hooks