DanielRiera / estimated-delivery-woocommerce

8 stars 6 forks source link

Disabled days ignored since last version #42

Closed elrosa closed 1 year ago

elrosa commented 1 year ago

Since the latest version, disabled days setting is ignored. My current date is May 2nd. Typical deliveries take between 2 to 3 working days. However, there are no deliveries from Wednesday until the end of the week; I selected these days as "disabled days". Screenshot_20230502_202925_com android chrome~2

Before the update, this setting was working as expected: if expected delivery date fell on a disabled day, it was moved to a next available date. However, now it's just adding 2-3 days to today's date and ignoring disabled days.

Screenshot_20230502_202944_com android chrome~3

The screenshot is in Polish, text below button says: estimated delivery on 4-5th May. This is Thursday and Friday, both days are disabled. I'd expect 8-9th May instead (Monday-Tuesday).

My website timezone is Europe/Warsaw (UTC+2). The server time is UTC, but changing timezone in WordPress doesn't help.

elrosa commented 1 year ago

My guess is that it happens because of change in this line, and only affects non-English sites: https://github.com/DanielRiera/estimated-delivery-woocommerce/blob/5426a1146d3e6b87c022b20b943313e64de61cd5/estimated-delivery-woocommerce.php#L239 The wp_date function returns localized date in provided format, in this case the day name. Because my site is in Polish, the returned string is Polish as well; so, for May 4th it returns "czwartek", which is obviously not included in the disabled days array.

DanielRiera commented 1 year ago

Hi @elrosa yes... Sorry 1.3.2 version fix this and add support for WCFM Multivendor. You can try new versión :)

Regards

elrosa commented 1 year ago

I can confirm it was fixed. Thank you! :)