Custom field date picker advanced - Waiting days does not exclude forbidden day

  • Posts: 3
  • Thank you received: 0
  • Hikashop Business
3 months 1 week ago #306671

-- HikaShop version -- : 4.1.0
-- Joomla version -- : 3.9.6
-- PHP version -- : 7.2
-- Browser(s) name and version -- : Chrome 74.0.3729.157


The issue ist with the date picker advanced. It is used to let the customer select the delivery date they want.
The products are books. The customers are teachers.

When an order is placed, it will be sent directly to our printery, they print the book and send it to the customers. From the date when the order is placed until the customer receive it, the prinery needs 4 days. Printery does not work on saturday and sunday also there is no delivery on saturday and sunday.

So i have set up Saturday and Sunday as forbidden days and Waiting days to 4.

Everything works fine if the day when the order is placed is an monday, as the next selectable date in the frontend is friday.
The problem is, if there is an weekend in between.

If the order Date is friday, the nex selectable date is Tuesday. So ist counting also the forbidden days.

As our printery does not work on Saturday and Sunday, the orders placed on fridays will not be delivered until Thursday of the next week.

Is there any posibillity to exclude the forbidden dates from the count?

Thanks in advance for your help.

Berst regards


Please Log in or Create an account to join the conversation.

  • Posts: 66630
  • Thank you received: 9810
3 months 1 week ago #306687


I see your problematic. There is no option you could change to handle that.
That would require modifying the code of the plugin to take into account the forbidden/excluded days in the waiting period.
While it's possible, it's not easy to do as it requires doing calculations to know whether the waiting period include these days or not and extend it accordingly.
And the calculations need to be done twice (the code will be a bit different in both places), when the field is displayed (so that the calendar is properly displayed), and when verifying the selected date after the selected value is sent to the website (so that people can't cheat).
So it will require several hours of work to do that properly.
If that's something you would like us to work on for you, you can use our contact form to ask a quote on that.
Don't forget including a link to this thread in your message:

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum