Results 1 to 10 of 544

Threaded View

  1. #11
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Order Delivery Date Support Thread

    Quote Originally Posted by kimono View Post
    Thank you very much.
    I am sorry that the reply was delayed.
    Is there a way to judge direction is 5, otherwise 7?
    More research is needed, but in the basic sense, additional javascript code can be used to provide a result of 5 or 7 depending on the result of the javascript method: getDay()

    Code:
     todayDate = new Date();
    curDay = todayDate.getDay();
    Direction : (curDay == 0 || curDay == 1 || curDay == 5 || curDay == 6) ? 5 : 7);
    The problem with the above is that it uses 5 for any time during Monday and Friday, not just after some cut-off time. Further, the function responds based on the date/time of the user not the store. So in the extreme case of a store being on one side of the date line, a customer on the other side may be offered a delivery time period outside of the expected/allowed time frame or may be provided a date that is sooner than possible. Additional date/time comparison would be needed to say make the comparisons on the left more "realistic" to your business if you deal with people outside of your central location. If they are local, then say where curDay == 1 && curTime < Mondays_cut_off_time would be what is needed, though would have to also identify/determine what Mondays_cut_off_time would be. The same would be needed for Friday but a little in reverse: curDay == 5 && curTime >= Fridays_cut_off_time. Oh, also would need to set/determine curTime... again more research would be needed on my side or as someone else offers up.

    Also, if additional "tests" are added as described, things like curDay == 1 && curTime < Mondays_cut_off_time would need to be surrounded by parentheses. So that the two pieces would be treated as one test.
    Last edited by mc12345678; 22 Aug 2017 at 02:53 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. order delivery date addon - date not showing in checkout
    By jagall in forum Addon Shipping Modules
    Replies: 4
    Last Post: 19 Oct 2017, 09:09 PM
  2. JK Order Exporter - Support Thread
    By eVelt in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 26 Sep 2015, 07:06 AM
  3. v151 Order Delivery date on Product Info Page
    By nicksab in forum General Questions
    Replies: 0
    Last Post: 30 Dec 2013, 03:23 AM
  4. Support Thread for JS Date Picker for options
    By eVelt in forum All Other Contributions/Addons
    Replies: 17
    Last Post: 5 Dec 2013, 05:44 AM
  5. Order Delivery Date Mod
    By fagriffin in forum Addon Shipping Modules
    Replies: 1
    Last Post: 11 Oct 2008, 04:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg