Open Hours
Open Hours
By wsnsupport
05/17/17 (Edited 08/21/17)
At Admin Panel -> Settings -> Switches, you have an "Open hours" option. This is for businesses or other organizations that are open at particular scheduled hours. When you enable open hours, you'll see an open hours field on the submit and edit listing pages and listing details page (you can customize the field at Admin -> Listings -> Link Fields -> Open hours).
Note that up to two sets of hours are supported for each day (this allows a place to have split hours with a break for lunch, like 8 AM - 12 PM and 1 PM - 5 PM). Using 3 or more sets for the same day may not sort correctly if entered non-chronologically, but very few businesses have 3 sets.
If you'd like to display the hours somewhere outside of the default location, you can use {LINKSHOWFIELD[hours]} or for a customized version you can copy and modify the custom display html from the Link Fields page into any other template where you're within the scope of a listing.
In the open hours display, today's hours are automatically bolded. This styling is from the application of the css class todayhours to all sets of hours that are for today. You can re-style as desired by adding .todayhours { } to your stylesheet.
There are a few useful template variables related to the hours:
{LINKHASHOURS} - Tests if the listing has any hours entered (for use in conditioanls).
{LINKISOPEN} - Tests if the business is currently open, for use in conditionals. Returns false if it's closed or has no hours entered.
{LINKCLOSINGSOON} - Tests if the business is currently open but is going to close within the next 60 minutes. For use in conditionals. Returns false if closed or if open for more than another hour. You can pass a parameter for a different number of minutes, like {LINKCLOSINGSOON[30]).
{LINKOPENSTATUS} - Displays "open", "closing soon" or "closed" (in English, so best used in conditionals)... or blank if there are no hours entered.
{LINKSHOWDAYHOURS[today]} - Displays the open hours (e.g. 8 AM - 5 PM) for the specified day parameter. The parameter can be 'today' or it can be a day of the week like Monday (which can be written out as Monday or as just Mon).
Note: these variables make the assumption that the viewer is in the same timezone as the business.
People can search by hours with either the simple or advanced search. For advanced searching, four radio options appear: "Any Time" (does not filter by hours), "Now" (filters to businesses currently open), "On __ at __" (filters to a particular time) and "On __ from __ until at least __" (filters to businesses open for the entirity of that length of time).
For any search form you may be using, whether it's simple or advanced search, you can include this simple checkbox to allow people to filter to businesses currently open: <input type="checkbox" name="openhoursquerytype" value="now">
Because the filtering by hours happens mostly on the php side rather than in the database query (which only filters by day open), you will notice that searches with large numbers of results have a different number of listings per page than normal. To account for the probability that the majority of the listings may be currently closed, WSN queries several times more listings than usual on the first page and then dynamically alters the number of listings per page for the subsequent pages to a value that seems appropriate to the results, in hopes of giving you something similar to the number of displayed results you want.
By wsnsupport
05/17/17 (Edited 08/21/17)
Note that up to two sets of hours are supported for each day (this allows a place to have split hours with a break for lunch, like 8 AM - 12 PM and 1 PM - 5 PM). Using 3 or more sets for the same day may not sort correctly if entered non-chronologically, but very few businesses have 3 sets.
If you'd like to display the hours somewhere outside of the default location, you can use {LINKSHOWFIELD[hours]} or for a customized version you can copy and modify the custom display html from the Link Fields page into any other template where you're within the scope of a listing.
In the open hours display, today's hours are automatically bolded. This styling is from the application of the css class todayhours to all sets of hours that are for today. You can re-style as desired by adding .todayhours { } to your stylesheet.
There are a few useful template variables related to the hours:
{LINKHASHOURS} - Tests if the listing has any hours entered (for use in conditioanls).
{LINKISOPEN} - Tests if the business is currently open, for use in conditionals. Returns false if it's closed or has no hours entered.
{LINKCLOSINGSOON} - Tests if the business is currently open but is going to close within the next 60 minutes. For use in conditionals. Returns false if closed or if open for more than another hour. You can pass a parameter for a different number of minutes, like {LINKCLOSINGSOON[30]).
{LINKOPENSTATUS} - Displays "open", "closing soon" or "closed" (in English, so best used in conditionals)... or blank if there are no hours entered.
{LINKSHOWDAYHOURS[today]} - Displays the open hours (e.g. 8 AM - 5 PM) for the specified day parameter. The parameter can be 'today' or it can be a day of the week like Monday (which can be written out as Monday or as just Mon).
Note: these variables make the assumption that the viewer is in the same timezone as the business.
People can search by hours with either the simple or advanced search. For advanced searching, four radio options appear: "Any Time" (does not filter by hours), "Now" (filters to businesses currently open), "On __ at __" (filters to a particular time) and "On __ from __ until at least __" (filters to businesses open for the entirity of that length of time).
For any search form you may be using, whether it's simple or advanced search, you can include this simple checkbox to allow people to filter to businesses currently open: <input type="checkbox" name="openhoursquerytype" value="now">
Because the filtering by hours happens mostly on the php side rather than in the database query (which only filters by day open), you will notice that searches with large numbers of results have a different number of listings per page than normal. To account for the probability that the majority of the listings may be currently closed, WSN queries several times more listings than usual on the first page and then dynamically alters the number of listings per page for the subsequent pages to a value that seems appropriate to the results, in hopes of giving you something similar to the number of displayed results you want.
Rating | |
Views | 86 views. Averaging 0 views per day. |