Hot answers tagged


Your full form code does contain a hidden input named action with the value send_form. However, you're not sending it correctly, because of the the contentType part in your JS script, which submits the form data as a JSON payload, but note that the old admin-ajax.php endpoint doesn't support JSON payload, hence $_REQUEST['action'] would be empty unless if ...


In the data property you need to pass the action to be called with the rest of your data. Based on you ajax action you action should be send_form data: { action: 'send_form', formData: $("#form_add_to_cart").serialize() } Now in your php callback function you can do print_r($_POST) to see what the post request contains.


The error message is clear; the function is not exist. It would help if you looked at your dependencies. You need jQuery Core, the jQuery UI library, and the jQuery Slider library. But no worries, you should use the dependency handling from WP API via wp_enqueue_script and his internal handles to load in the correct order. wp_register_script( 'your-...

Only top voted, non community-wiki answers of a minimum length are eligible