How to add custom Data to the WooCommerce Products PDF?

If you want to add / show some custom data like post meta or similar, you can use one of our hooks. An example:

 add_filter( 'woocommerce_pdf_catalog_before_product_information_categories', 'show_case_pack_in_pdf', 10, 2);
 function show_case_pack_in_pdf ($html, $id) {
 	$product = wc_get_product($id);
 	$pid= $product->get_id();

 	$case_pack = get_post_meta($pid,'case_pack',true); 

	$html = 'Case Pack: ' . $case_pack;

	return $html;

Deja una respuesta

Tu dirección de correo electrónico no será publicada.