Title: adding the dni field
Last modified: February 10, 2020

---

# adding the dni field

 *  [atilvas](https://wordpress.org/support/users/atilvas/)
 * (@atilvas)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/adding-the-dni-field/)
 * I am trying to configure the dni field with the following code.
    /** *Incluir
   NIF en la factura (necesario el plugin WooCommerce PDF Invoices & Packing Slips)*/
 * add_filter( ‘wpo_wcpdf_billing_address’, ‘incluir_nif_en_factura’ );
 * function incluir_nif_en_factura( $address ){
    global $wpo_wcpdf;
 *  echo $address . ‘<p>’;
    $wpo_wcpdf->custom_field( ‘NIF’, ‘NIF: ‘ ); echo ‘</
   p>’; }
 * I find that parts of the web stop working for me.
 * I see that the variable wpo_wcpdf is in desusom you can help me.

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [kluver](https://wordpress.org/support/users/kluver/)
 * (@kluver)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/adding-the-dni-field/#post-12426460)
 * Hi [@atilvas](https://wordpress.org/support/users/atilvas/),
 * You can use the following code snippet (assuming the NIF number is stored under
   the ‘NIF’ meta key in your order meta):
 *     ```
       add_action('wpo_wcpdf_after_billing_address', 'wpo_wcpdf_add_nif_number', 10, 2);
       function wpo_wcpdf_add_nif_number ( $template_type, $order ) {
       	if ( !empty( $order->get_meta( 'NIF' ) ) && $template_type == 'invoice' ) {
       		printf( '<p class="nif_number">NIF number: %s</p>', $order->get_meta( 'NIF' ) );
       	}
       }
       ```
   
    -  This reply was modified 6 years, 5 months ago by [kluver](https://wordpress.org/support/users/kluver/).

Viewing 1 replies (of 1 total)

The topic ‘adding the dni field’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-pdf-invoices-packing-slips/assets/icon-256x256.
   png?rev=2189942)
 * [PDF Invoices & Packing Slips for WooCommerce](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-pdf-invoices-packing-slips/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [kluver](https://wordpress.org/support/users/kluver/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/adding-the-dni-field/#post-12426460)
 * Status: not resolved