i am using a snippet code to show customer if he order before 4pm he will receive the order today.
this message should be seen under add to cart on the product , but on your theme it show as a notification and disappear later , how i can keep it under the cart.
this is the code that am using:
add_action( ‘woocommerce_after_add_to_cart_form’, ‘bbloomer_dispatch_info_single_product’ );
function bbloomer_dispatch_info_single_product() {
date_default_timezone_set( ‘Europe/London’ );
// if FRI/SAT/SUN delivery will be MON
if ( date( ‘N’ ) >= 5 ) {
$del_day = date( “l jS F”, strtotime( “next monday” ) );
$order_by = “Monday”;
}
// if MON/THU after 4PM delivery will be TOMORROW
elseif ( date( ‘H’ ) >= 16 ) {
$del_day = date( “l jS F”, strtotime( “tomorrow” ) );
$order_by = “tomorrow”;
}
// if MON/THU before 4PM delivery will be TODAY
else {
$del_day = date( “l jS F”, strtotime( “today” ) );
$order_by = “today”;
}
$html = “
“;
echo $html;
}