• Resolved martentiman

    (@martentiman)


    Hi, this is not a question but more of a solution really. I’m also kind of surprised this is not incorporated into the premium version of the plugin yet… Anyway, if you are using the Woocommerce PDF invoices and Packing Slips plugin you are able to create a custom Template for your invoices which you can store in your Theme. The EU Vat Compiance plugin stores the VAT number in the usermeta field in your database. If you want to show your customer’s VAT number on your PDF, add the following code in your template:

    
    //get customer VAT number
    global $wpo_wcpdf; 
    $customer_id = $wpo_wcpdf->export->order->customer_id;
    $key = "vat_number";
    $customer_vat_data = get_user_meta($customer_id, $key);  
    $customer_vat_nr = $customer_vat_data[0];
    //OUTPUT
    echo "VAT nr: ". $customer_vat_nr;
    

    Hope this helps for anyone using this plugin. Cheers,
    Marten

    • This topic was modified 7 years, 3 months ago by martentiman.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Showing VAT number on PDF invoice’ is closed to new replies.