Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

Add a Contact Form to the WooCommerce Single Product Page

People visit your store, some not, some understand everything, some not.They may not be interested in your product or they may just need to know something but they left because there are not enough information.

What if they have questions? By default they can’t ask you anything directly from the product page. The only option is to contact you directly via email, via phone call or any other way you specified in your site and contact page.

The easiest way to let customers get in touch about a specific product, is to add a Contact Form 7 below the Add to Cart button.

I show a button called “Product Inquiry” (you can call the button whatever you like e.g. “Request a Quote” ), I initially hide the contact form via CSS display:none, and then with a bit of JQuery I have the hidden form show when the “Product Inquiry” button is clicked.

You first need to install Contact Form 7 Plugin and create a standard form. Then, get the form shortcode and use it in beow code. which you can add in your theme’s functions.php file of your active child theme (or theme).

add_action( 'woocommerce_single_product_summary', 'woocommerce_contactform7_single_product', 30 );
  function woocommerce_contactform7_single_product() {
   echo do_shortcode('[paste_your_contact_form_7_shortcode_here]');
}
Exit mobile version