It’s not possible right now. I’ll make a note to consider this for a future version, because I think it’s a cool idea!
Thanks!
hi, i did it myself.. quick& dirty offcourse in BussinenssHours.class.php
$blogtime = current_time('timestamp');
$currenthour = date("g",$blogtime);
$openhour = date("g", $open);
if ( $is_open_today ) {
if ($openhour < $currenthour)
{
$content = str_replace( "{{TodayOpen}}", $open, $content );
$content = str_replace( "{{TodayClose}}", $close, $content );
}
else $content = $closed;
} else {
$content = $closed;
}
return $content;
Ignore previous, this one works … 😀
$open = esc_html( business_hours()->settings()->get_open_hour( $id ) );
$close = esc_html( business_hours()->settings()->get_close_hour( $id ) );
$is_open_today = business_hours()->settings()->is_open( $id );
$blogtime = current_time('timestamp');
$currenthour = date("H:i",$blogtime); //convert to 24h notation
$openhour = date($open);
$closehour = date($close);
//echo $currenthour .'We are open from ' . $openhour . 'h till ' . $closehour;
if ( $is_open_today ) {
if (($openhour <= $currenthour) && ($closehour >= $currenthour))
{
$content = str_replace( "{{TodayOpen}}", $open, $content );
$content = str_replace( "{{TodayClose}}", $close, $content );
}
else $content = $closed;
} else {
$content = $closed;
}
return $content;
}
David
(@vdrumsrolandchartertnnet)
I simply can not get this to work. Where exactly did you put the code? I understand you put it inside the BusinessHours.class.php.
I’m not too PHP savvy.
David
(@vdrumsrolandchartertnnet)
Is this a dead plugin?
I was hoping to use this plugin because it uses the exception list making it fully automatic. However, I can not get the above code to work at all. If anyone with some knowledge on this could help me out, I would greatly appreciate it.
I want it to say closed when it’s after business hours, and open when the business is open. I do not want it to say open for the entire day.
Thank You!
David, the plugin is not dead, and I’m working on a new version with some new features and a lot of bug fixes… but as I commented on my first message, the functionality you’re looking for is not currently supported.
There were a lot of requests for it, though, so I’m considering adding it to the next release.
Just a comment about this. The open and close times are not actually times. Those are text fields that allow you to set whatever you want (by design). I know for a fact that some users, for instance, use the word “noon” instead of 12:00. So if I get to implement this, it needs to be optional.