Ecommerce Shopify WordPress Discussion

Elementor Pro Form Widget Submission returns parsererror

i created a WordPress plugin for Elementor Pro form, which will capture the form submission data and send that data to other db then proceed and also save the response in elementor form submission. now the issue is when the form is submitted it submitted well but a parseerror show below the form instead of the Thank you! success message. i also enabled the custom message option in the form widget. here's the code plugin code <?php /** * Plugin Name: Elementor API Capture * Description: Custom plugin to capture Elementor form submissions and send to API. * Version: 1.1 */ // Hook into Elementor form submission add_action('wp_ajax_elementor_pro_forms_send_form', 'capture_elementor_form_submission'); add_action('wp_ajax_nopriv_elementor_pro_forms_send_form', 'capture_elementor_form_submission'); function capture_elementor_form_submission() { // Access the form data submitted by Elementor $post_data = $_POST['form_fields']; // print_r($post_data);die; /* * 🔺 Your API Request Logic Here 🔺 * Prepare data to send to the API */ $siteName = $_SERVER['SERVER_NAME']; // echo $siteName; $post_data['source'] = $siteName; // print_r($post_data);die; // Make the API request $response = wp_remote_post('api-end-point', array( 'body' => $post_data // 'headers' => array('Content-Type' => 'application/json'), )); // print_r($response);die; // Check for API request success if (is_wp_error($response)) { // Handle API request error echo 'API Request Error: ' . $response->get_error_message(); } else { // API request successful $api_response = json_decode(wp_remote_retrieve_body($response), true); echo 'API Response: ' . json_encode($api_response); } /* * 🔺 END HERE 🔺 */ // Continue with Elementor's form submission handling include_once(plugin_dir_path(__FILE__) . 'elementor-pro/modules/forms/classes/ajax-handler.php'); $ajax_handler = new ElementorPro\Modules\Forms\Classes\Ajax_Handler(); $ajax_handler->ajax_send_form(); // Make sure to exit to prevent further processing of Elementor's form submission exit; } response after form submission i created a WordPress plugin for Elementor Pro form, which will capture the form submission data and send that data to other db then proceed and also save the response in elementor form submission. now when the form is submitted the form is submitted and data is also pushed to the database but on the front-end instead of showing the success message below the form it shows the parseerror. i enabled the custom form message option in the Elementor Pro Form Widget.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.