Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MinaPansuriya/9812405af50e46d8ae95680571d190ac to your computer and use it in GitHub Desktop.
Save MinaPansuriya/9812405af50e46d8ae95680571d190ac to your computer and use it in GitHub Desktop.
/**
* @Title: Add Product Inquiry tab to WooCommerce Single Product Page
* @Author: Mina Pansuriya
* @Website: http://minapansuriya.com
*/
add_filter( 'woocommerce_product_tabs', 'pbs_woo_add_product_inquiry_tab', 98 );
function pbs_woo_add_product_inquiry_tab( $tabs ) {
$tabs['pbs_inquiry_tab']['callback'] = 'pbs_woo_custom_desc_tab_content'; // Callback function for description tab
$tabs['pbs_inquiry_tab']['title'] = 'Product Inquiry';
$tabs['pbs_inquiry_tab']['priority'] = 40;
return $tabs;
}
function pbs_woo_custom_desc_tab_content() {
echo '<h2>Product Inquiry</h2>';
echo '<p>Please fill below form to send product inquiry</p>';
// Note: Change below shortcode with your Contact Form 7 Shortcode
echo do_shortcode('[contact-form-7 id="3" title="Contact form 1"]');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment