-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Lead time NOT work #1004
Comments
Isn't this what supposed to happen? |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. If this issue is still relevant or you would like to see it actioned, please respond and we will re-open this issue. If this issue is critical to your business, consider the Dedicated Support Service where a Service Level Agreement is offered. |
I also noticed this issue, which didn't happen on earlier versions. The issue misses one step I think: it's important that you enable: Allow Pre-order for Delivery. Now the issue is: the lead time is not added anymore, only when you turn on the "Add lead time to Delivery start time". Why do you not want to enable this feature, but still have lead times? In short I think the issue can be found in the Location.php class in the ti-ext-local extension, see: https://github.com/tastyigniter/ti-ext-local/blob/3137bf9e5863409d6d18aa66a3ac183f67d96afb/classes/Location.php#L306 Essentially LeadTime should be 0 for all days in the future, and for today when the current time + lead time is smaller than the first delivery / pick-up time. However, it should be enabled once today starts getting into first delivery / pickup time - lead time. Workaround |
@sampoyigi I tested tastyigniter/ti-ext-local#87 and it fixed the issue. Thanks @krozendaal |
@krozendaal So, just to be clear, when the current time is less than (20:00 - lead time), the first delivery time is 20:00 + lead time, but when the current time is exactly 20:00 - 1 minute, that is 19:59, the first delivery time is 20:00 instead of 20:00 + lead time? Is this only true when the current time is one minute before the delivery start time (19:59) or when the current time is between (20:00 - lead time) and 20:00? |
Hi @sampoyigi, Not exactly. When you turn on "Allow Pre-order for Delivery", but turn off "Add lead time to Delivery start time", the lead time is disregarded in general (which makes sense looking at the code for ti-ext-local). Also after 20:00 in my example. So let's say it's 20:14, than the first option in the list is 20:15 (if the block time is set to 15 minutes for example). This is logicial if the minimum days to order in pre-order is set to > 0 (e.g. 1). In this case, it's never possible that the lead time is necessary. However, then the minimum days to order in pre-order is set to 0, it's possible that an order comes in on the current day, for which the lead time should always be added for the first option. Just to make it a little bit more visual here are some examples: I hope this makes it a little bit more clear. My pull request in the ti-ext-local repo removes all the options that are within the current time + lead time time frame. It's probably not the best way of doing this, but I couldn't think of another way of doing it, without needing extra functions. This way the lead time is always respected, without the option of "Add lead time to Delivery start time" turned on. |
Got it, thank you. But, you can enable Add lead time to Delivery start time? This way the first option will be opening time + lead time. |
Yes, that’s correct. If you enable “Add lead time to delivery start time”, the first option is indeed opening time + lead time. The workaround I provided in an earlier post shows this works as it should, however than the delivery times/pick up times don’t correspond to the real values. |
Ok, i'll review the PR once i get the chance to. |
What happened?
Lead time stops working if the option to "add lead time to opening hours" is disabled.
What did you expect to happen?
Lead time should always work.
Version
3.5.x
What browser are you seeing the problem on?
Firefox, Chrome
Relevant log output
No response
The text was updated successfully, but these errors were encountered: