Open maxlaf opened 2 years ago
@maxlaf seems like the reason is that there must be check-in and out times set. Otherwise, customers may get confused about when they should arrive and/or when they have to leave. I think this is why the plugin sets 2 PM as a default in/out time. Removing the Arrival/Departure tab would mean that we also need to tweak the code and have to assume and set another in/out time (maybe 12 AM?) because, without it, we can not calculate the availability. But again that does not worth it because we again end up assuming/setting another default time, i.e. 12 AM.
Perhaps we should display 2 PM on the setting page instead of just "--:-- --", if store owner does not set any time.
Affected ticket(s)
5647172-zen
What I expected
If the check-in/out time isn't set under Bookings > Settings > Accommodation, it shouldn't be displayed in the product data tabs.
What happened instead
If the check-in/out time isn't set by the user, it defaults to 14:00.
Steps to reproduce the issue
Additional Info
From my amateur glance, it looks like the Arrival/Departure tab shouldn't be displayed if the check-in/out times are empty: https://github.com/woocommerce/woocommerce-accommodation-bookings/blob/145f6434109a974e0fd50543fb91b7998a68862a/includes/class-wc-accommodation-booking-product-tabs.php#L77
But
get_check_times
returns 14:00 if it's not set: https://github.com/woocommerce/woocommerce-accommodation-bookings/blob/145f6434109a974e0fd50543fb91b7998a68862a/includes/class-wc-product-accommodation-booking.php#L343