I am trying to place a CF7 Contact form on the product details page. I have used the WooCommerce hook woocommerce_before_add_to_cart_button
for that.
add_action( 'woocommerce_before_add_to_cart_button', 'custom_before_add_to_cart_btn' );
function custom_before_add_to_cart_btn() {
echo do_shortcode( '[contact-form-7 id="69" title="Contact form 1"]' );
}
But on submitting the form, the page is actually getting refreshed. The Ajax is no longer working. I got no errors in the Console, so i don't think it's a JS issue.
It is a fresh WooCommerce Storefront Installation, no other plug-ins or anything. Do you guys have any idea how this is happening and how can I get around this ?
This is the screencast of what's exactly happening : Screencast
script.js
bein gloaded? Likely not due to the fact that the woocommerece hook fires after the page script enqueue action. I would try to usewp_register_script
to register cf7 scripts/css on page enqueue action.