People visit your store, some converts, 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.
There’s a way to let them ask you questions directly from the product page via email, by adding an enquiry form in the tabs below the product summary, where the description and additional information are.
How to do this?
As always, there are various way to do it, and today you will learn two of them.
The easy way
The easiest way is by using a plugin. You can use Product Enquiry Form to add a form on all product pages. It will appear exactly in the tabs after the product’s summary.
The email sent through that form will be received in your inbox using the email specified for the admin in the WordPress general settings.
It also supports reCAPTCHA by using their API to avoid spam emails.
The hard way
If you don’t want to buy the plugin above and have some coding skills, you can code the form by yourself. First you have to install and create a form with a 3rd-party plugin like Contact Form 7 or Ninja Forms.
Create a form with the plugin and copy its shortcode. You will need it later.
Now open your functions.php file located in wp-content/themes/your-theme-name/ and add this code at the end of the file:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_product_tabs', 'woo_edit_tabs' ); | |
function woo_edit_tabs( $tabs ) { | |
// Adds the new tab | |
$tabs['enquiry_form'] = array( | |
'title' => __( 'Ask a question', 'woocommerce' ), | |
'priority' => 50, | |
'callback' => 'woo_enquiry_form' | |
); | |
return $tabs; | |
} | |
function woo_enquiry_form() { | |
echo '<h2>' . __( 'Do you have a question?', 'woocommerce' ) . '</h2>'; | |
echo '<p>' . __( 'Drop us a line by compiling the form below. We will be more than happy to reply to any of your questions!', 'woocommerce' ) . '</p>'; | |
echo do_shortcode( '[your_form_shortcode_here]' ); | |
} |
Note: Replace [your_form_shortcode_here]
with the shortcode you copied before!
You will now have an enquiry form on your product page.
If you don’t want to add code at all, you can also create the custom tab by using the plugin WooCommerce Tab Manager.
Leave a Reply