php - I Need To Display My delivery Time In diffrent place in my wordpress site
one text
function bn_delievery_day() { global $product;
date_default_timezone_set('Asia/Kolkata');
$now_time = time();
$is_week_days = in_array( date('w'), array( 1, 2, 3, 4 ) ) ? true : false; // From Monday to Thursday
$is_friday = date('w') == 5 ? true : false; // Friday
$is_week_end = in_array( date('w'), array( 0, 6 ) ) ? true : false; // Weekend days
$end_time = mktime('5', '00', '00', date('m'), date('d'), date('Y')); // 12h00
$now_time = time();
$after_tomorow = date('l', strtotime('+2 days'));
// Displayed day conditions
// Check if the product has categories. Use the category slug instead of the category name.
if (has_term( array( 'Cakes', 'chocos-flavour', 'fruits-flavour' ), 'product_cat', $product->get_id() ) ) {
// if the product does have a matching category.
//
$thresshold = '1800'; //time after 6
$time =date("Hi");
if ($time < $thresshold && $time > '0000') {
$delivery_day = 'Today';
}
else {
$delivery_day = 'Tomorrow';
}
echo '<p class="deliveryline">' . __("Next Delivery: ", "woocommerce") . $delivery_day;
return;
}
} add_action( 'woocommerce_single_product_summary', 'bn_delievery_day', 45 );
I added Some Snippets to Display delivery Time But its shows Down side I want Display upside of Add to Cart Button this my Snippet
Source