Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
¿Cómo obtener el número de pedido después de enviar el formulario a través de ajax?

El pedido se crea después de enviar el formulario.

 add_action( 'wp_footer', 'mycustom_wp_footer' ); function mycustom_wp_footer() { ?> <script> document.addEventListener( 'wpcf7submit', function( event ) { var inputs = event.detail.inputs; console.log(inputs); }, false ); </script> <?php }

Necesito obtener el número de pedido inmediatamente después de crearlo desde el formulario

 add_action('wp_ajax_hello', 'say_hello1'); add_action('wp_ajax_nopriv_hello', 'say_hello1'); function say_hello1() { if (empty ( $_POST['order_id'])) { $order_id = absint( get_query_var('view-order') ); $testart = $order_id; } else { $testart = ( $_POST['order_id']); } echo "Проверка, $testart!"; wp_die(); }

Estoy tratando de obtener el número de pedido al hacer clic en el formulario de envío para poder decírselo al cliente. no puedo hacer nada

 add_action( 'wp_footer', 'my_action_javascript25', 99 ); function my_action_javascript25() { ?> <script> document.addEventListener( 'wpcf7submit', function( event ) { var datax = { action: 'hello', order_id: 'testpage' }; jQuery.post( ajaxurl, datax, function( response ){ alert( 'Получено с сервера: ' + response ); } ); } ); </script> <?php }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!