• 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

    (@kluver)

    Hi @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.
Viewing 1 replies (of 1 total)

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