Hi, we use a View to display WooCommerce orders.
Once received, we have to update some custom fields on the front end through a cred form.
Is it possible to have the view automatically refresh when receiving new orders?
I could add a page refresh at regular intervals, but this is a problem when we are filling the form, as it won't retain the data if the refresh happen before we press the submit button.
Hello. Thank you for contacting the Toolset support.
There is no way to refresh the view automatically.
You may add your form or page A and once that form is submitted you can redirect user to page B where you have added the view. I hope this is clear. So, you will have two pages page A that should hold the form and page B that should hold the view.
That won't work.
The customers just make the order and see the typical WooCommerce page at the end of the process.
What we need to update is the View for our staff, which are adding the necessary order's information through a Cred form.
I was more hoping for a way to refresh the view when idle (e.g. no mouse or keyboard activity).
Hello there! Minesh won't be available for a couple of days. If you don't mind, I'll continue with you on this ticket.
I believe we can implement a way to refresh the view without reloading the whole page. But, currently, we do not have a way to trigger this refresh when a form has been completed.
Regarding the view refreshing, we can rely on AJAX search. By adding a search form on the view with a submit button. The form can be hidden with CSS. And triggering the AJAX refresh using Javascript. We can trigger a click event on the submit button, and let Toolset refresh the view using AJAX.
Assuming that we implemented a Javascript solution to trigger the AJAX search, IMHO, I would agree with using it when the browser is idle(as you said, no mouse or keyboard activity). There are 3rd party Javascript libraries that offer such features. Check these online resources:
- hidden link
- hidden link
- hidden link
- hidden link
I hope this helps. Let me know if you have any questions.
Thanks Jamal for the suggestions.
As I already have a date and a name Ajax search in this view, I guess I could use one of them to refresh the page, instead of adding a new one.
Still I haven't really understood how do I trigger the search button with one of the library you suggested.