Not doing Ajax if Shortcode is used
-
Good Day,
I added a contact form to a page using contact form 7 shortcode inside a shortcode and it … everything works fine except that the contact form 7 doesn’t submit over Ajax but reloads the page with something like this as the URL (https://localhost/WEBSITE/request-quote/?product-name=random%20name#wpcf7-f3123-p3143-o2)function get_for_which_product_text($atts, $content) { $atts = shortcode_atts( array( 'content' => '[contact-form-7 id="3123"]', ), $atts, 'load-for-which-product-request-quote' ); ob_start(); if (isset($_GET['product-name'])) { $getProductTitle = $_GET['product-name']; $product_link = get_page_by_title($getProductTitle, OBJECT, 'product'); $context = __('for %1s%2s%3s', GET_TEXT_DOMAIN); ?> <div class="request_custom-quote"> <p><?php echo sprintf(__('Fill The form below to request quote %s', GET_TEXT_DOMAIN),$context); ?></p> <p><?php echo __('If you have any questions or would like more information regarding services or estimates, please use our %1$s%2$scontact page%3$s%4$s instead or call: %2$sPHONE NUMBER%3$s.', GET_TEXT_DOMAIN); ?></p> <div class="the_rcq_form"><?= do_shortcode($atts['content']); ?></div> </div> <?php } return ob_get_clean(); } add_shortcode('load-for-which-product-request-quote', 'get_for_which_product_text');
What am i doing wrong?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Not doing Ajax if Shortcode is used’ is closed to new replies.