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

317
Visualizações
Add Estimated delivery date range?

I want to add an estimated delivery date range. For example, if ordered today (21st Feb)

The required output should be something this:

Estimated delivery by 24 Feb, Thursday to 26 Feb, Saturday

add_action( 'woocommerce_single_product_summary', 'delivery_date_range',11 );
    
function delivery_date_range() {
   date_default_timezone_set( 'India' );  
    
 // date_from must be from 3rd day (from order date)
 // date_to must be the next 5th days
   
  $html = "<br><div>Estimated delivery by {$date_from} to {$date_to}</div>";
    
   echo $html;
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

add_action('woocommerce_single_product_summary', 'delivery_date_range', 11);

function delivery_date_range() {

    // date_from must be from 3rd day (from order date)
    // date_to must be the next 5th days
    $date = date('Y-m-d');
    $three_day_from_today = date('j F, Y', strtotime($date . ' + 3 days'));
    $fifth_day_from_today = date('j F, Y', strtotime($date . ' + 5 days'));

    $html = "<br><div>Estimated delivery by {$three_day_from_today} to {$fifth_day_from_today}</div>";

    echo $html;
}

Check the manual for PHP date format

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