Skip to content

Commit

Permalink
Store VAT number from "WooCommerce EU VAT Number" plugin in customer/…
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Nov 28, 2023
1 parent d45053b commit ba05c39
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/OrderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ public function get_customer() {
$customer->set_company_name( $company_name );
}

/**
* VAT Number.
*
* @link https://woo.com/products/eu-vat-number/
* @link https://github.com/pronamic/woocommerce-eu-vat-number/blob/v2.8.3/includes/class-wc-eu-vat-number.php#L648
* @link https://github.com/pronamic/wp-pronamic-pay-easy-digital-downloads/blob/v4.3.4/src/Gateway.php#L398-L407
*/
$vat_number = (string) $order->get_meta( '_billing_vat_number' );

if ( '' !== $vat_number ) {
$customer->set_vat_number( $vat_number );
}

return $customer;
}

Expand Down

0 comments on commit ba05c39

Please sign in to comment.