How to add additional fields in the request quote form

If you want to add the more fields in the request quote form such as Fone number address etc. You’ll have to follow the below steps

Step 1: Add Fields in functions.php File

First, you need to add the new fields to the form. This involves updating the functions.php file of your child theme (or using a code snippet plugin if you prefer not to modify the theme files directly).

      1. Open functions.php of your child theme.
      2. Add the following code snippet to include the phone number and address fields or as many fields as you want.

Step 2: Override the Template

Next, you need to update the email template to display these new fields in email. This involves overriding the default template in your child theme.

  1. Copy the author-email-content.php file from the WooCommerce Price Quote Pro plugin to your child theme. The original template path in the plugin will be wp-content/plugins/woocommerce-price-quote-pro/templates/author-email-content.php.
  2. Paste the copied template into your child theme at the following path: wp-content/themes/my-child-theme/woocommerce-price-quote-pro/author-email-content.php.
wp-content/themes/my-child-theme/woocommerce-price-quote-pro/author-email-content.php

Step 3: Modify the Template

Edit the overridden template to include the new fields.

  1. Open author-email-content.php in your child theme.
  2. Locate line 30 (or the appropriate place where you want the new fields to appear) and add the following lines:
<br>Phone Number: <?php echo $phone_number; ?> 

<br>Address: <?php echo $address; ?>
For example, if you have added a phone number field and the field name is number, you would add:
<br>Phone Number: <?php echo $number; ?>

Additional Points

  • If you’re using a code snippet plugin, you can add the code from Step 1 directly into the plugin’s interface instead of modifying functions.php.
  • Refer to the plugin documentation for more details on template overriding if needed. https://docs.wbcomdesigns.com/docs/woo-commerce-price-enquiry-quote-pro/template-override-woo-commerce-price-enquiry-quote-pro/override-the-email-template/
Update on June 19, 2024