WC-Local-Pickup/woocommerce-local-pickup-time

Disable Open Start/End Times to Match Store Open Days

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
The store hours don't present a visible way to clear the hours for cases when the store isn't open on those days. You can highlight the hours/minutes and delete the with the keyboard but this isn't obvious.

Describe the solution you'd like
Add an obvious way to disable the day so it would be cleared, perhaps a checkbox that clears & disables the start/end time.

Describe alternatives you've considered
A clear button next to each time field that simply blanks it out.

Additional context
image

Waiting for this to be addressed, I would suggest this small addition to disable days with same open and close time. Anyway it could be seen as something logical because if you open and close at the same time then you don't stay opened enough to allow any pick-up ;)

Here /public/class-local-pickup-time.php#L566
You may simply replace :

if (
	! in_array( $pickup_datetime->format( 'm/d/Y' ), $dates_closed, true ) &&
	! empty( $pickup_day_open_time ) &&
	! empty( $pickup_day_close_time )
) {

with :

if (
	! in_array( $pickup_datetime->format( 'm/d/Y' ), $dates_closed, true ) &&
	! empty( $pickup_day_open_time ) &&
	! empty( $pickup_day_close_time ) &&
	$pickup_day_open_time !== $pickup_day_close_time
) {

Séb.