Ecommerce Shopify WordPress Discussion

bad request in wordpress ajax [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 19 hours ago. Improve this question I'm trying to save a custom field which any unlogged user in wordpress inputs in a form but when I try to save by ajax I get a bad request: <script> jQuery('#custom_field_vendor').ready(function($){ var customFieldValue = $('#custom_field_vendor').val(); $('#your_button_id').on('click', function (){ $.ajax({ url: "/wp-admin/admin-ajax.php", data: { action: 'saving_requested_vendor', custom_field_vendor: customFieldValue }, method: "POST", success : function( response ){ console.log(response) }, error: function(jqXHR, textStatus, errorThrown) { // Lógica a ser executada em caso de erro na requisição AJAX console.error('Erro na requisição AJAX:', textStatus, errorThrown); } }); }); }); </script> I tried to log in admin account to see if it's due some auth problem but it's not, I cant see the problem, the hook is not the problem, this script is embedded in add_action('woocommerce_before_checkout_form', 'custom_checkout_field');
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.