kluver
Forum Replies Created
-
Hi @apexdigitalro,
Presumably the exchange rate, and perhaps product prices in a second currency, are stored in the order meta and/or order item meta. To find this data you can use the following guide: Finding WooCommerce custom fields
To get this data on your documents you can use this guide: Displaying a custom field
Hi @mzn001,
Could you also check if you get any specific fatal errors or error that start with wpo_wcpdf_ and that have a timestamp that corresponds with the time the email should have been sent?
You can check for errors in your logs via WooCommerce > Status > Logs.
Hi @pdsxerox,
No worries, you have the correct filter. You can change the title to ‘Quote’ when the payment method is cod like this:
add_filter( 'wpo_wcpdf_invoice_title', 'wpo_wcpdf_change_title_based_on_payment_method', 10, 2 ); function wpo_wcpdf_change_title_based_on_payment_method ( $title, $document ) { if ( $order = $document->order ) { if ( $order->get_payment_method() == 'cod' ) $title = 'Quote'; } return $title; }Please note that, like my colleague explained, this will cause gaps in your invoice number sequence. As some invoices will be relabeled as quote. If you want to setup a proper quote/proposal workflow you might want to check out our WooCommerce Order Proposal plugin.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Text Area Line BreaksHi @giftsociety,
When testing this with a custom text area from the TM Extra Product Options plugin all line breaks in the invoice are preserved. So I’m unable to reproduce the issue. Are you using the latest version of our plugin (2.9.3)? Or are you using a custom template or a custom code snippet to add the text area to your invoice?
Hi @hydroscorpus,
Your order shows no tax data. That is why this also isn’t showing up on the PDF. This means you haven’t setup your WooCommerce taxes in the correct way. To troubleshoot this please read the following guide: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/displaying-taxes/
- This reply was modified 4 years, 10 months ago by kluver.
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] confused how it worksHi @yashsharma1,
I would suggest contacting Zoho and see if they can troubleshoot this issue for you. Our plugin is not responsible for sending any emails, we simply add a PDF attachment to the already existing emails.
Hi @buzzsanderson,
You can change this right in the plugin settings. Please be aware that this might create gaps in your invoice number sequence. More information about why we suggest to use the built-in invoice number sequence and how to change it to the order number here: https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/invoice-numbers-explained/
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Custom Field on Packing SlipHi @mparsons501979,
You can add custom text to the packing slip by using one of our available action hooks. To check if the text has to be displayed you can use the helper function from this Stack Overflow answer that checks if the user already has made a purchase before: https://stackoverflow.com/questions/38874189/checking-if-customer-has-already-bought-something-in-woocommerce/46216073#46216073
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Get Invoice locationHi @waffeltje,
You should be able to generate the PDF like this:
if ( $order = wc_get_order( $order_id ) ) { $invoice = wcpdf_get_invoice( $order, true ); $pdf = $invoice->get_pdf(); }Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] Price changingHi @kenteush29,
Our PDF Invoices plugin takes the data from the underlying WooCommerce order to create the invoice. But if I understand correctly you don’t want to change the order itself?
You can filter the products and totals on your PDF with the following two filters:
Product table:
add_filter( 'wpo_wcpdf_order_items_data', 'wpo_wcpdf_order_items_data', 10, 3 ); function wpo_wcpdf_order_items_data ( $items, $order, $template_type ) { //Your logic goes here... }Totals table:
add_filter( 'wpo_wcpdf_woocommerce_totals', 'wpo_wcpdf_woocommerce_totals' , 10, 3 ); function wpo_wcpdf_woocommerce_totals( $totals, $order, $template_type ) { //Your logic goes here... }These code snippets should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you have never worked with code snippets or functions.php before please read this: How to use filters
You can add custom CSS in the style.css file of your custom template (assuming you’ve copied all the files from the Simple template). To target only the packing slip you can use the
.packing-slipbody class. So to reduce the font size you can add this at the bottom of the style.css file:.packing-slip { font-size: 7pt; }This will reduce the font size of the whole document. To target only a part, for instance the document label, you can do this:
.packing-slip h1.document-type-label { font-size: 7pt; }Hi @clement93,
You should be able to easily hide this with some custom CSS. To find the CSS classes you need to target you can render the document in HTML modus. To do this select ‘Open the PDF in a new browser tab/window’ option via: WooCommerce > PDF Invoices > General > How do you want to view the PDF?
Then open a PDF invoices that contains the uploaded images. And add the following to the URL:
&output=htmlThen reload the page. This will render the PDF in HTML. Now you can inspect the HTML elements and their CSS classes. In Chrome: right-click the element and select ‘Inspect’.
To add custom CSS to your documents you can either use our Premium Templates extension, which will let you add CSS right in the plugin settings. Or use the following action hook:
add_action( 'wpo_wcpdf_custom_styles', 'wpo_wcpdf_hide_uploaded_images' ); function wpo_wcpdf_hide_uploaded_images () { ?> /* Your CSS here... */ <?php }This code snippet should be added to the functions.php of your child theme or via a plugin like Code Snippets. If you haven’t worked with code snippets or functions.php before please read this: How to use filters
Hi @romandas,
There is no easy way to switch between two custom templates based on order meta. You will have to build your logic into one custom template.
If the layout between the LT en EN documents are roughly the same you can collect the data of your custom checkbox at the top of your document and use it to hide or show certain elements. Or change text based on its value.
$english = $order->get_meta( 'your_meta_key_here' ); if ( $english ) { //EN logic here... } else { //LT logic here... }If the layout of your LT and EN documents is completely different you will have to customize a second document. For instance the packing slip. If you are already using the packing slip you can purchase our Professional extension. This will give you access to the proforma, which you can customize to suit your needs.
After you’ve setup your two documents you can use a filter to block one of the two from being created and/or sent based on the value of your checkbox.
add_filter( 'wpo_wcpdf_document_is_allowed', 'wpo_wcpdf_send_document_based_on_checkout_language', 10, 2 ); function wpo_wcpdf_send_document_based_on_checkout_language ( $condition, $document ) { if ( $order = $document->order ) { $english = $order->get_meta( 'your_meta_key_here' ); $document_type = $document->type; switch ( $document_type ) { case 'invoice': // Block LT document when checkbox is checked if ( $english ) $condition = false; break; case 'packing-slip': // Block EN document when checkbox is unchecked if ( !$english ) $condition = false; break; } } return $condition; }Code snippets like this should be added to the functions.php of your child theme or via a plugin like Code Snippets.
Hi @tarundeology,
For adding a custom field like a shipping phone number you can use the following guide: Displaying a custom field
Forum: Plugins
In reply to: [PDF Invoices & Packing Slips for WooCommerce] mail fieldHi @victortorneiros,
In that case you will have two options. You can reach out to the developers of the ‘WC – APG Field’ plugin and ask if there is an easy way of removing the email address from the billing address on the PDF.
Or you can try to overwrite the address format yourself. The easiest way would be with our Professional extension, although this might depend on where in the process the ‘WC – APG Field’ plugin customizes the address. If it fires later than our plugin the changes might still be overwritten.
Another option is to change the address format WooCommerce wide with a filter. More information on changing the address format (with either the Professional extension or with a filter) here: Changing the address format