Delivery date @ product

0.0/5
<?php
add_action( 'woocommerce_before_add_to_cart_form', 'bbloomer_dispatch_info_single_product' );
    
function bbloomer_dispatch_info_single_product() {
   if ( get_site_url() == 'https://reclar.cz' or get_site_url() == 'https://reclar.sk') {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "pondělí";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +1 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Předpokládané doručení {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +1 day" ) );
	  $html = "<div>Předpokládané doručení {$del_day} </div>";
   }
 
  
   
   echo $html;
   }
   if ( get_site_url() == 'https://reclar.eu' or get_site_url() == 'https://reclar.co.uk' ) {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "Monday";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +3 day" ) );
	  $html = "<div>Expected delivery {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Expected delivery {$del_day} </div>";
   }
 
  
   
   echo $html;
   }
   if ( get_site_url() == 'https://reclar.fr' ) {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "Lundi";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +3 day" ) );
	  $html = "<div>Livraison attendue {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Livraison attendue {$del_day} </div>";
   }
 
  
   
   echo $html;
   }
   
   if ( get_site_url() == 'https://reclar.de' ) {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "Montag";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +3 day" ) );
	  $html = "<div>Lieferung vorgesehen an {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Lieferung vorgesehen an {$del_day} </div>";
   }
 
   echo $html;
   }
	
   if ( get_site_url() == 'https://reclar.it' ) {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "Lunedi";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +3 day" ) );
	  $html = "<div>Consegna prevista: {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Consegna prevista:  {$del_day} </div>";
   }
 
   echo $html;
   }
   
   if ( get_site_url() == 'https://reclar.pl' ) {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "poniedziałek";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +3 day" ) );
	  $html = "<div>Oczekiwana dostawa {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Oczekiwana dostawa  {$del_day} </div>";
   }
 
   echo $html;
   }
	
   if ( get_site_url() == 'https://reclar.es' ) {
                      
              
   date_default_timezone_set( 'Europe/Prague' );  
    
   // if FRI/SAT/SUN delivery will be MON
   if ( date( 'N' ) >= 5 ) {
      $del_day = date( "d. m. Y", strtotime( "next monday" ) );
      $order_by = "lunes";
   } 
    
   // if MON/THU after 4PM delivery will be TOMORROW
   elseif ( date( 'H' ) >= 12 ) {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $del_day_1 = date( "d. m. Y", strtotime( "tomorrow +3 day" ) );
	  $html = "<div>Fecha de entrega estimada {$del_day} - {$del_day_1}</div>";
   } 
    
   // if MON/THU before 4PM delivery will be TODAY
   else {
      $del_day = date( "d. m. Y", strtotime( "tomorrow +2 day" ) );
	  $html = "<div>Fecha de entrega estimada {$del_day} </div>";
   }
 
   echo $html;
   }
   

}

Comments and reviews

{{ reviewsTotal }} Review
{{ reviewsTotal }} Reviews
{{ options.labels.newReviewButton }}
{{ userData.canReview.message }}

Description

This snippet was fetched automatically from WPDistro.cz projects.

Author

Tags

This snippet is untagged