Okay
  Public Ticket #3400858
Blocking one week out of two
Closed

Comments

  • bosbusiness started the conversation

    Hello, 

    For a customer who has an employee who is only present one week out of two, I would like to block one week out of two. 

    I've written a little code for this but it doesn't seem to work: 

    function block_week_alternative_amelia($availability, $serviceId, $staffId, $date) {
    // ID of the member of staff for whom you want to block weeks
    $staff_id = 5; // Replace 123 with the actual ID of the member of staff

    $week_number = date('W', strtotime($date));
    // Replace the line above with `$week_number = date('W', strtotime($date)) + 1;`
    // if you want to start with the first blocked week.

    if ($staffId == $staff_id && $week_number % 2 == 0) {
    // Block even-numbered weeks for the specified member of staff
    $availability = false;
    }

    return $availability;
    }
    add_filter('amelia_get_service_staff_availability', 'bloque_semaine_alternative_amelia', 10, 4);


    Can you help me? 

    Translated with DeepL

  •  1,339
    Marko replied

    Hello,

    Thank you for purchasing our product, and for reaching out to us.

    If you already have our licenses, please write to us in the Amelia category. 

    The reason we ask you to do this is that there has been a lot of abuse. 

    Because if the license has expired and the subscription has not been renewed, these users do not have access to our support, the same applies to licenses that are purchased through Envato. 

    Licenses purchased through Envato have access to our support for only 6 months when that time period has to elapse they have to contract Envato to extend the time for support.

    We hope you understand.

    Unfortunately, currently, this feature is not built-in in Amelia. And this can not be achieved with a small piece of code at this time. But what you can do is you can use special days and you can set special days i week time range. We do understand that this is a lot more work to set this up but this is the only way at this time.

    If you have any more questions please open a new separate ticket for each question and we will gladly help you there.

    We wish you all the best.

    Have a nice day. 

    Kind Regards, 

    Marko Davidovic
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables