I am trying to show a Minute Countdown 30 minutes before my eCommerce store's closing time. Basically, you have "29 minutes & 32 seconds to place an order".
I have the current script that is pulling store hours from several ACF (advanced custom fields) time picker fields. I am also pulling my stores date and time correctly... I just don't know how to pull it all together to show the message 30 minutes before and initialize the countdown.
function sat_clock() {
$format = get_option('date_format') . ' ' . get_option('time_format');
$hour = the_field('weekday_open', 'options');
$times = array(
'mon' => '9:00 AM - 9:00 PM',
'tue' => '9:00 AM - 9:00 PM',
'wed' => '9:00 AM - 9:00 PM',
'thu' => '9:00 AM - 9:00 PM',
'fri' => '9:00 AM - 9:00 PM',
'sat' => '11:00 AM - 6:00 PM',
'sun' => 'closed'
);
print date_i18n($format, current_time('timestamp'));
print $hour;
}
add_action( 'woocommerce_archive_description', 'sat_clock' );