In some installs, store owners want to allow customers to reset the booking form. This is especially useful when a maximum stay is enforced.
For example, if the maximum stay is set to 14 days and a customer selects both a start and finish date, then later decides to change the start date, they may be unable to select a new date range beyond the original two-week window. This can cause confusion and prevent the customer from completing their booking.
To resolve this, you can add a Reset button to the booking form. This button clears the selected start and finish dates, allowing the customer to begin their selection again.
Adding the Reset Button
To add this functionality:
Open the
booking-form.snippetfile in your theme.Add the reset button markup and supporting JavaScript to this file.
Key sections in the snippet:
Line 18: Defines the Reset button.
Lines 28–43: Contain the additional JavaScript that clears the start and finish date fields when the button is clicked.
Once added, customers will be able to reset the booking form and reselect their desired date range without running into maximum-stay restrictions.
Comments
2 comments
Hello and thank you for creating this.
Is this still valid snippet code, and if so can we get a repost of it? It is not showing here on the page any longer.
Thank you!
Hi Steve,
Sorry about that. I needed to update the Zendesk settings.
You should be able to see the code now.
Thanks, Gavin.
Please sign in to leave a comment.