Pre Sales Question
-
I need to have two functions on a date field:
1. Allows for a restricted range of dates to be selected (so only Monday through Thursday in each week is available)
2. A lead time on ordering – if it is after 1pm, then the next day or two is unavailable for selection
Can your plugin manage this?
-
Hi @darklightlaser,
Sorry for the late reply. The notification went to spam :/ really sorry about that.
If you are still interested:
1. Yes, you can exclude Friday, Saturday, and Sunday with our “Datepicker: Exclude days” option (it’s in the “Datepicker/Weekpicker Type Options” settings subsection).
2. Currently you can only set fixed starting dates availability. There is “Min date” option (again in the “Datepicker/Weekpicker Type Options” subsection) – if you set it to
0day, then available dates will start from today, if it’s1day, then from tomorrow, and so on. However, your task seems like it could be a useful feature in our plugin, and should be quite easy to implement. Let me try to do it now, I will get back to you in a minute…I can give you a snippet that achieves this in a similar plugin, if that is of use.
Thank you, but I’ve already implemented it more or less. Will be releasing a new plugin version in 30 minutes or so.
Wow. That was quick.
Thanks πWow. That was quick.
π
Ok, I’ve just released a new plugin version (v1.6.1). After the update, please go to custom field’s settings, and set the “Min date” option (in “Datepicker/Weekpicker Type Options”) to something like:
[alg_wc_ccf_if value1="{alg_wc_ccf_datetime format='Gi'}" operator="greater" value2="1300" then="1" else="0"]This will set the first available date to tomorrow, in case if it’s after 1 PM.
Settings may not look too user-friendly, however, this way we have a lot of customization options. Let me try to explain it a bit more.
So in latest plugin version I’ve added two new shortcodes:
[alg_wc_ccf_datetime]and[alg_wc_ccf_if].[alg_wc_ccf_datetime]returns current date and time. It has only one attribute:format. Accepted format is the same as in PHP date function. So this –[alg_wc_ccf_datetime format="Gi"]– will return1300if it’s 1 PM now.[alg_wc_ccf_if]allows us to compare values. It has 5 available attributes:value1,value2,operator,thenandelse. Attributes are generally self-explanatory, and possibleoperatorvalues are:equal,not_equal,less,less_or_equal,greaterorgreater_or_equal.And last note – as we can’t use square brackets
[]inside shortcode attributes, we replace them with curly brackets{}. And similarly, we replace double quotes"with single quotes'.So to sum up – we are taking
value1(current date inGiformat, e.g. 1310) and checking if it’sgreaterthanvalue2(i.e.1300). If it is, we set “Min date” to “1” (i.e.then), if it’s not, then we set “Min date” to “0” (i.e.elseattribute).Hope this makes sense. Please give it a try and let me know if it’s working as expected, or if you have any questions.
It’s near Midnight Friday here. I’ll check it out next week and let you know how it goes for me.
Thank you for the prompt attention to my functionality enquiry.
Cheers!Sure, take all the time you need. And thank you for the idea.
Hi @darklightlaser,
Sorry for bothering you, but maybe you had a chance to check it?
Hi @darklightlaser,
I will mark the thread as “resolved” for now, hope that’s ok. Please let me know if there are any questions or issues.
Sorry. I’ve been pulled aside to another project and have not had time to test this. I appreciate you making the change, and will get to this as soon as I practically can π
CHEERS!
Hi @darklightlaser,
Sure, I understand, no problem.
The topic ‘Pre Sales Question’ is closed to new replies.