filiperjbr
Forum Replies Created
Viewing 7 replies - 1 through 7 (of 7 total)
-
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na Faturaunderstood, and thank you so much to explain, but your last code, dont worked.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na FaturaThank you very much for your time, now I know the error was in the shipping_address, based on that I made the following modifications.
Now it works on invoice and packing-slip. Thank you very muchadd_action ('wpo_wcpdf_after_shipping_address', function ($template_type, $order) { if ($template_type == 'packing-slip') { $invoice = wcpdf_get_document ('packing-slip', $order); // if cnpj exists, show it if ( !empty($invoice-> get_custom_field ('billing_cnpj') ) ) { echo '<br>CNPJ:' . $invoice-> get_custom_field ('billing_cnpj'); // otherwise, show the cpf } else { echo '<br>CPF: '. $invoice-> get_custom_field ('billing_cpf'); } } }, 10, 2);
and
add_action ('wpo_wcpdf_after_billing_address', function ($template_type, $order) { if ($template_type == 'invoice') { $invoice = wcpdf_get_document ('invoice', $order); // if cnpj exists, show it if ( !empty($invoice-> get_custom_field ('billing_cnpj') ) ) { echo '<br>CNPJ:' . $invoice-> get_custom_field ('billing_cnpj'); // otherwise, show the cpf } else { echo '<br>CPF: '. $invoice-> get_custom_field ('billing_cpf'); } } }, 10, 2);
i′m using code snippet plugin.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na FaturaMy field names are billing_cnpj and billing_cpf because in pdf invoice its work code, only and packing-slip no.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na Faturadont work bro, dont get anything.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na Faturaadd_action ('wpo_wcpdf_before_billing_address', function ($template_type, $order) { if ($template_type == 'invoice') { $invoice = wcpdf_get_document ('invoice', $order); // if cnpj exists, show it if ( !empty($invoice-> get_custom_field ('billing_cnpj') ) { echo '<br>CNPJ: ' . $invoice-> get_custom_field ('billing_cnpj'); // otherwise, show the cpf } else { echo '<br>CPF: '. $invoice-> get_custom_field ('billing_cpf'); } } }, 10, 2);
This code its work only INVOICE and Dont Work in Packing-slip
- This reply was modified 3 years ago by filiperjbr.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na Faturabut if my client has CNPJ ? and Thank you so much ….
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] CPF na FaturaPlease, I would like add function in packing-slip too. How can i do it?
Viewing 7 replies - 1 through 7 (of 7 total)