0

I would like to print the VAT number (provided by module vat_number) on the invoice PDFs generated by module commerce_billy, but I can not figure out, how to retrieve VAT number when an order ID is given.

1 Answer 1

0

It took me a while to figure it out, but now I've found an answer myself:

$profile_id = $order->content['commerce_customer_eu_vat_rc']['#items'][0]['profile_id'];
$profile_wrapper = commerce_customer_profile_load($profile_id);
$vat_id = $profile_wrapper->commerce_vat_number['und'][0]['value'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.