I wanna show an weekday status into a dynamic page. This will work based on a item showed, in other words, I'm showing one business at time in my dynamic page, so, each one has a week schedule.
I've found a site who made a code that I want to make dynamic and show it based on business that displayed on my dynamic page. For example: Business#1 is open just in week days, from 08:00 AM to 18:00 PM, and the code get the user current weekday and hour, and display a status: Is open now or Is closed now.
The website that creates my intended code:
https://codepen.io/zeinab92/pen/xwWGWM#code-area
But what about if you had multiple businesses listed? How can I have it pull from the dataset the times that it is opened and compare to current time?
Here's a simple example for displaying if a business is "Open for Business":
View the Live Demo
Open the Example in the Editor
Shows how to display if a business is currently "open for business". Get's the user's current date and time, checks if the business is currently open according to the configured business hours, and displays the current status. Also displays the business hours and highlights the current day's hours.
Hello @Lista Locall I was wondering if you were able to figure this out. Currently trying to build same code based on my dataset of multiple businesses with various hours of operations. I see above not much help was given. Let me know!
Hi Lista,
It is not possible to interact with third party apps using wix code.
However a system of displaying business hours for multiple businesses can be achieved with some coding:
Start by creating a collection with a list of businesses and their matching business hours.
Each business should go in its own line.
You will have to add fields for: business name, open hour on Sunday, close hour on Sunday, open hour on Monday and etc.
Then simply connect the dynamic page to each field.
To display a 'Open to business' message you will have to write a function to retrieve the current day and time and compare it against the relevant collection record opening hours.
Good luck!
Wix already has a awesome app to do this for me(Online Bussines Card, by Appsharp), but I can't set it dynamically to change with my item page. If has some way to each item shows a diferent content on the app, my problems will be solved
Hi,
Welcome to the Wix Code forums.
You might be able to embed this code in an HtmlComponent. You can read more in the article Working with the HTML Component in Wix Code.
You might get better results by building your own indicator using Wix page components together with the logic provided in the code that you referred to.
Good luck,
Yisrael