Hi @americiu,
It is likely because you are placing your custom PDF template within a parent theme, instead of a child theme, therefore, every time your parent theme is updated, this action replaces any change you have applied with the new files coming from the update.
To avoid this behavior and keep your custom PDF template untouched, you can follow one of these methods:
- Using the Custom PDF Template extension: This is a plugin to which you can move your template directory (within the
/templates/ folder), and then install it in your site.
- Creating a child theme: This is very easy to do with the Child Theme Configurator, generate the child theme, and then uninstall it. After creating the child theme, you just need to put your custom PDF template in the
your-theme-child/woocommerce/pdf directory, and that’s it!
Let me know if you need more help!
Hi @yordansoares,
The PDF template belongs to the plugin, not a theme.
It is under /wp-content/plugins/woocommerce-pdf-invoices-packing-slips/templates/[Custom].
Every time I update the plugin, the custom PDF template is also removed…
Hi @americiu,
Yes, I know you are referring to our PDF templates, and what is happening, based on your latest comment, is that you are editing the core files, which is a bad practice.
You need to follow any of the steps I mentioned above. Also, check this guide to learn more Creating a custom PDF template.
Let me know whether you managed to set it up, or you need more help! 😉
Hi @americiu,
This is a follow-up message to find out if you managed to solve the problem by following any of the methods I mentioned above.
If you still need help with this, let me know and I will do my best to provide assistance 😉
I followed your steps, and it works just fine. Thank you!
Thanks for confirming that it worked, @americiu! 🎉
Let me know if you need anything else 😉