• Resolved DarkLight Digital

    (@darklightlaser)


    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?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    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 0 day, then available dates will start from today, if it’s 1 day, 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…

    Thread Starter DarkLight Digital

    (@darklightlaser)

    I can give you a snippet that achieves this in a similar plugin, if that is of use.

    Plugin Author Algoritmika

    (@algoritmika)

    @darklightlaser,

    Thank you, but I’ve already implemented it more or less. Will be releasing a new plugin version in 30 minutes or so.

    Thread Starter DarkLight Digital

    (@darklightlaser)

    Wow. That was quick.
    Thanks ??

    Plugin Author Algoritmika

    (@algoritmika)

    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 return 1300 if it’s 1 PM now.

    [alg_wc_ccf_if] allows us to compare values. It has 5 available attributes: value1, value2, operator, then and else. Attributes are generally self-explanatory, and possible operator values are: equal, not_equal, less, less_or_equal, greater or greater_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 in Gi format, e.g. 1310) and checking if it’s greater than value2 (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. else attribute).

    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.

    Thread Starter DarkLight Digital

    (@darklightlaser)

    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!

    Plugin Author Algoritmika

    (@algoritmika)

    @darklightlaser,

    Sure, take all the time you need. And thank you for the idea.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @darklightlaser,

    Sorry for bothering you, but maybe you had a chance to check it?

    Plugin Author Algoritmika

    (@algoritmika)

    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.

    Thread Starter DarkLight Digital

    (@darklightlaser)

    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!

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @darklightlaser,

    Sure, I understand, no problem.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Pre Sales Question’ is closed to new replies.