Skip to content

Instantly share code, notes, and snippets.

@swoboda
Created August 22, 2017 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swoboda/349b6955910fe64abd1f47e4b9010b9d to your computer and use it in GitHub Desktop.
Save swoboda/349b6955910fe64abd1f47e4b9010b9d to your computer and use it in GitHub Desktop.
vat_number_checkout_en.php
<?php
// Do NOT include the opening php tag shown above. Copy the code shown below.
add_action( 'woocommerce_after_order_notes', 'wpdesk_vat_field' );
/**
* VAT Number in WooCommerce Checkout
*/
function wpdesk_vat_field( $checkout ) {
echo '<div id="wpdesk_vat_field"><h2>' . __('VAT Number') . '</h2>';
woocommerce_form_field( 'vat_number', array(
'type' => 'text',
'class' => array( 'vat-number-field form-row-wide') ,
'label' => __( 'VAT Number' ),
'placeholder' => __( 'Enter your VAT number' ),
), $checkout->get_value( 'vat_number' ));
echo '</div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment