Custom field does not work with latest update

[ad_1]

Hi @lomacs,

Please note that this happened because you are using deprecated code that we started removing on the latest version. Actually, these legacy code is very old, that we kept them for long time in order to provide support to old WooCommerce versions. However, since WooCommerce started bumping the minimal requirements, we chose to follow the same approach.

That said, please replace that code snippet with this one to fix the issue:

/**
 * PDF Invoices & Packing Slips for WooCommerce:
 * Mostrar el NIF en los documentos PDF
 */

add_filter( 'wpo_wcpdf_billing_address', function( $address, $document ) {
	if ( ( $order = $document->order ) && ( $nif = $order->get_meta( 'NIF' ) ) ) {
		$address .= sprintf( '<p>NIF: %s</p>', $nif ); 
	}
	return $address;
}, 10, 2 );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer