Description: This guide will walk you through the process of overriding template files in the Product Enquiry Pro (PEP) plugin by copying them into your theme or child theme. You can customize the design and functionality of the plugin by modifying these files without affecting the original plugin templates. Here’s how you can do it step-by-step with examples.
Paragraph Explanation:
The Product Enquiry Pro (PEP) plugin comes with certain template files that control how different sections of the plugin are displayed. If you want to change the way these sections appear, you can override the default templates provided by the plugin. The good news is that you don’t have to edit the original plugin files directly. Instead, you can copy these templates into your theme or child theme and modify them there. This method ensures that your changes won’t be lost when you update the plugin.
How to Override a Template:
- Find the template file: The first step is to locate the template file you want to customize. These templates are usually found inside the plugin folder. For instance, in Product Enquiry Pro, you might find a template located at
/product-enquiry-pro/templates/public/enquiry-mail/products-table-head.php. - Create a new directory in your theme: Once you have identified the file, you need to create a specific folder inside your theme or child theme. This folder should be named
quoteup. Make sure to maintain the same file structure as in the plugin. However, you don’t need to include the/templates/folder when copying the file. - Copy the file: Now, copy the template file you want to modify and paste it into your new
quoteupdirectory. Make sure to match the structure of the original file location, except for the/templates/folder. For example:- Original location in the plugin:
/product-enquiry-pro/templates/public/enquiry-mail/products-table-head.phpNew location in your theme:/your_theme_or_child_theme/quoteup/public/enquiry-mail/products-table-head.php
By doing this, WordPress will use the file in your theme instead of the one in the plugin. - Original location in the plugin:
Example 1: Overriding the Enquiry Email Table Header
If you want to modify the appearance of the products table in the enquiry emails, you would:
- Locate the template:
/product-enquiry-pro/templates/public/enquiry-mail/products-table-head.php - Create the folder structure:
/your_theme_or_child_theme/quoteup/public/enquiry-mail/ - Copy the file to this location:
/your_theme_or_child_theme/quoteup/public/enquiry-mail/products-table-head.php - Now, you can edit the
products-table-head.phpfile in your theme folder without affecting the original plugin file.
Example 2: Overriding the Tax and Shipping Note in PDFs
Let’s say you want to change the way tax and shipping notes are displayed in the Quote PDF generated by the plugin. Follow these steps:
- Locate the template:
/product-enquiry-pro/templates/admin/pdf-quote/tax-shipping-note.php - Create the folder structure:
/your_theme_or_child_theme/quoteup/admin/pdf-quote/ - Copy the file to this location:
/your_theme_or_child_theme/quoteup/admin/pdf-quote/tax-shipping-note.php - Once copied, you can edit the file in your theme to customize the tax and shipping notes in the PDF quote.
Final Thoughts:
By following this process, you can customize any template file from the Product Enquiry Pro plugin without modifying the core plugin itself. This ensures that your changes are preserved, even if the plugin is updated in the future.
Simply find the template you want to modify, create the same folder structure in your theme, and copy the file over. Then, make your changes in the copied file. This method is safe, effective, and widely used in WordPress development.