Error after upgrade to 3.7.7 version

[ad_1]

Hi, since 2017 we use your plugin and we used this code to include in the invoice a custom field we have in the order ( using the plugin Checkout Field Editor (Checkout Manager) for WooCommerce – WordPress plugin | WordPress.org) …. the code is the following:

// add_filter( 'wpo_wcpdf_billing_address', 'incluir_nif_cif_en_factura' );

function incluir_nif_cif_en_factura( $address ){
  global $wpo_wcpdf;

  echo $address . '<p>';
  $wpo_wcpdf->custom_field( 'billing_nif_cif', 'NIF/CIF: ' );
  echo '</p>';
}

we update to the last version and the code give us an error on creating the invoice:

Fatal error: Call to a member function custom_field() on null
/var/www/html/wordpress/wp-content/themes/ascend_premium_child/functions.php (211)
#0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(326): incluir_nif_cif_en_factura()
#1 /var/www/html/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters()
#2 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document-methods.php(93): apply_filters()
#3 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document-methods.php(102): WPO\WC\PDF_Invoices\Documents\Order_Document_Methods->get_billing_address()
#4 /var/www/html/wordpress/wp-content/themes/ascend_premium_child/woocommerce/pdf/Simple Premium No fecha pedido si envio /invoice.php(31): WPO\WC\PDF_Invoices\Documents\Order_Document_Methods->billing_address()
#5 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(1138): include('/var/www/html/w...')
#6 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(982): WPO\WC\PDF_Invoices\Documents\Order_Document->render_template()
#7 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(937): WPO\WC\PDF_Invoices\Documents\Order_Document->get_html()
#8 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(1004): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf()
#9 /var/www/html/wordpress/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(580): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf()
#10 /var/www/html/wordpress/wp-includes/class-wp-hook.php(324): WPO\WC\PDF_Invoices\Main->generate_document_ajax()
#11 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#12 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
#13 /var/www/html/wordpress/wp-admin/admin-ajax.php(188): do_action()
#14 {main}

how can we fix it? thank you very much

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

 

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