Issue with PDF Invoices & Packing Slips for WooCommerce

Hi @closemarketing,

I’m part of the WP Overnight team, the company behind the PDF Invoices & Packing Slips for WooCommerce.

Today we received an issue report from one of your users in which they said our plugin is causing an error that prevents to generate the PDF invoice. We realized that the issue is causing by the VAT Number injection you’re doing here: /includes/class-public.php#L135

To fix this, you need to do the following:

1. Update the hook on Line 18 with this:

add_filter( 'wpo_wcpdf_billing_address', array( $this, 'add_vat_invoices' ), 10, 2 );

2. Update the method on lines 135-141 with this:

public function add_vat_invoices( $address, $document ) {
	if ( ( $order = $document->order ) && ( $vat = $order->get_meta( '_billing_vat' ) ) ) {
		$address .= sprintf( '<p>%1$s %2$s</p>', __( 'VAT info:', 'import-holded-products-woocommerce' ), $vat ); 
	}
	return $address;
}

Let me know if you have any question or need more help on this! 😉

 

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