• Resolved carloseuita

    (@carloseuita)


    Hi,

    I had the following code snippet in the functions.php file before the latest update of your plugin:

    // Include NIF in the invoice 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( 'billing_dni', 'NIF: ' ); echo '</p>'; }

    Since updating the plugin, the invoices are not generating correctly. Could you please assist me in modifying this code so that it correctly adds the client’s ID (NIF) to the invoice?

    Thank you.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Contributor Darren Peyou

    (@dpeyou)

    Hey @carloseuita,

    It appears you are using an “old version” of the code snippet, meaning to say that it was written while using a very old version of the plugin.

    Could you give this updated version a try and let us know the result?

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Include NIF in PDF
     * NIF meta key = billing_dni
     */
    add_filter( 'wpo_wcpdf_billing_address', function( $address, $document ) {
    	if ( ( $order = $document->order ) && ( $nif = $order->get_meta( 'billing_dni' ) ) ) {
    		$address .= sprintf( '<p>NIF: %s</p>', $nif ); 
    	}
    	return $address;
    }, 10, 2 );
Viewing 1 replies (of 1 total)
  • The topic ‘Error Including NIF on Invoice After Plugin Update’ is closed to new replies.