How to Change the Language and Date Format in Your WooCommerce PDF Invoices
Content
Many WooCommerce store owners use the 'PDF Invoices & Packing Slips for WooCommerce' plugin to generate professional documents. A common challenge is customizing these documents to match your store's locale, specifically changing the language of labels like "Invoice" or the format of dates. This guide explains why this happens and walks you through the most common solutions.
Why Are My PDF Document Labels or Dates in the Wrong Format?
The plugin is designed to be multilingual, but the translation of static text (like the document title "Invoice") and the formatting of dates are handled by different systems within WordPress and the plugin itself. The issue often stems from one of the following:
- Incomplete Translation: The plugin's text may not be fully translated for your site's language.
- Date Meta Key: When using the meta key
_wcpdf_invoice_date_formattedin other plugins, the date format is set by the PDF plugin and may not match your regional preference. - Setup Wizard Settings: The initial setup wizard helps configure basic settings, and skipping it can sometimes lead to unexpected defaults.
Common Solutions to Change Language and Date Format
1. Re-run the Setup Wizard
If you skipped the setup wizard during installation, it's a good first step to ensure your base settings are correct. This can help apply the correct language defaults.
- Go to WooCommerce > PDF Invoices > Status.
- Click on "Run the Setup Wizard".
- Follow the steps to configure your documents.
2. Check Your Language Pack
The primary method for translating the word "Invoice" and other labels is through the official WordPress translation system. The document name in the free version is translated automatically if a language pack for your locale is available and fully updated.
- Ensure your WordPress site's language is set correctly in Settings > General > Site Language.
- Check the translation status for your language on the official plugin translation page. If the translation is incomplete, this may explain why some text remains in English.
3. Use a Different Meta Key for Dates
If you are using a plugin like Advanced Order Export for WooCommerce and need to change the date format retrieved via the _wcpdf_invoice_date_formatted meta key, you have a technical workaround. The formatted date is fixed, but you can access the raw timestamp and reformat it.
Instead of using _wcpdf_invoice_date_formatted, use the meta key _wcpdf_invoice_date. This returns a timestamp. You can then use your export plugin's functionality (if available) to convert this timestamp into your preferred date format (e.g., dd/mm/YYYY). If your export plugin does not support custom date formatting from a timestamp, you may need to explore custom code solutions.
4. Clear Existing Plugin Settings
If you believe old settings are causing a problem and want to start fresh, you can reset the plugin's data. Warning: This will delete all your current settings.
- Deactivate and delete the 'PDF Invoices & Packing Slips for WooCommerce' plugin from your Plugins page.
- Using a database management tool like phpMyAdmin, search your WordPress database's
wp_optionstable (the prefix may be different) for options with names starting withwpo_wcpdfand delete them. - Reinstall the plugin. You will be able to run the setup wizard again.
By following these steps, you should be able to better align your PDF documents with your store's language and regional date preferences. For more complex customizations, such as setting custom document titles without relying on language packs, the 'PDF Invoices & Packing Slips for WooCommerce' team offers premium extensions that provide greater control.
Related Support Threads Support
-
I need b&w documentshttps://wordpress.org/support/topic/i-need-bw-documents/
-
Changing date format used for “_wcpdf_invoice_date_formatted” meta keyhttps://wordpress.org/support/topic/changing-date-format-used-for-_wcpdf_invoice_date_formatted-meta-key/
-
can’t change the name ‘invoice’ to FR on the PDFhttps://wordpress.org/support/topic/cant-change-the-name-invoice-to-fr-on-the-pdf/