• Resolved bodarax

    (@bodarax)


    Hello everyone,

    I love the We’re Open! plugin. However lately I worked a lot with special opening hours. Your FAQ stated that special hours are not available through the Google API, however, this is not true (anymore).

    With “Place API (new)” you can receive “regularOpeningHours” and “currentOpeningHours”.
    https://developers.google.com/maps/documentation/places/web-service/place-details

    Example GET call: https://places.googleapis.com/v1/places/PLACE_ID?fields=regularOpeningHours%2CcurrentOpeningHours&key=API_KEY

    currentOpeningHours gives you the next 7 days, modified with special hours, and also tells you which days were modified.

    You can also request “regularSecondaryOpeningHours” and “currentSecondaryOpeningHours” which will provide information like dinner or drive-in hours.

    I would love to have the currentOpeningHours included.
    (And a way to set how often to grab the data from Google (every minute, hourly, daily, monthly))

    Thanks for reading, and please let me know if I can help you in any way. I can provide you i.e. with an api key and some credits for testing.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Design Extreme

    (@designextreme)

    @bodarax Thanks! I’ll have a look at this in the coming days. ??

    Plugin Author Design Extreme

    (@designextreme)

    @bodarax I did see the new version of the Place API was introducing new data for opening hours.

    I do remember considering new functionality here, but I did have second thoughts about this at the time.

    The issue is the limited period covered by the “current” opening hours. The dates are listed for each of these and this can be compared against the regular opening hours. So, if it differs from the regular opening hours it implies it is “special”.

    The API only returning 7 days inclusive of today limits its value – and, if applied, it would deliver incorrect opening hours for anything over a week ahead. This isn’t ideal.

    I will consider introducing this in a future release with a note about its limitation. Provided no more than 7 days are never shown/checked it could offer some use to business owners who update through Google My Business.

    With the update frequency, it defaults to once every 24 hours. However, you can manually edit this to one of the following integers in the wp_options table:

    Name: we_are_open_frequency
    Value: 1, 2, 3, 4, 6, 8, 12, 24 (or null/empty)

    Please do reply with your own thoughts on this.

    Thread Starter bodarax

    (@bodarax)

    @designextreme I agree that 7 days is not ideal.

    I can tell you, why for me it would be useful:
    The website is for a beach restaurant, which has regular hours but will also open early on days with good weather.
    Currently, that means, they publish additional hours on a daily basis. They would like to have that reflected on their website so that customers can check if they are open or not.

    I would give users the option to import regular house and special hours independently. A warning that only the next 7 days will be imported should appear. As a compromise, it should be possible to still enter dates that are further in the future and only have them updated when they fall in the next 7 days (maybe give them a checkbox “don’t sync with Google” or only override days which are also special days in google).

    I can’t speak for every industry/ person, but I think most customers looking for opening hours only check for today, tomorrow, or the next weekend. One exception I can think of is restaurants on Christmas or similar big holidays. But Google also doesn’t display that information, and most business owners will advise these days in a special form anyway.

    Btw. you don’t have to compare regular and current opening hours because you get “specialDays” in the currentOpeningHours request, which tells you the modified days.

    And thanks, I found the we_are_open_frequency option.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Place API (new) does support special hours’ is closed to new replies.