Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
How to clear WooCommerce billing email and billing phone checkout fields after place order?

How do I clear a specfic checkout fields in WooCommerce after placing an order?

For example Billing email and Billing Phone. So that when the registered customer makes his/her next order, he/she has to fill that fields again?

I see this code, but this clean all the fields, i need only a specific field. Any advice?

add_filter('woocommerce_checkout_get_value','__return_empty_string',10);
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

The woocommerce_checkout_get_value hook has 2 arguments:

  • $value argument that is returned
  • $input argument to target checkout field(s)

So in your case, you get:

function filter_woocommerce_checkout_get_value( $value, $input ) {
    // Target checkout fields. Multiple fields can be added, separated by a comma
    if ( in_array( $input, array( 'billing_phone', 'billing_email' ) ) ) {
        $value = '';
    }

    return $value;
}
add_filter( 'woocommerce_checkout_get_value' , 'filter_woocommerce_checkout_get_value' , 10, 2 );
over 4 years ago · Santiago Trujillo Relatório

0

You could probably achieve this with some custom javascript:

document.getElementById('fieldID').value = ''

Or jQuery:

$('#fieldID').val('');
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda