Announcement

Collapse
No announcement yet.

Specifying a Delivery Cut-Off Time for Orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Specifying a Delivery Cut-Off Time for Orders

    I have cut and pasted the relvant code and placed it on my primary template however it does't seem to work, anyone know what im doing wrong???

    <script language=JavaScript>
    now = new Date();
    if ( now.getHours() >= 16.30 ) document.write('<font color=red>Warning
    text here</font>');
    </script>

    Thanks

    #2
    Hi there

    Where did you get this code from?

    Kind Regards
    Nadeem Rasool
    SellerDeck Development

    Comment


      #3
      page 51 of the advance user guide v7

      Comment


        #4
        I wrote that. It's probably on the Forum somewhere. The only problems I see is that the getHours() function only returns the hour as an integer 0 .. 23 so comparing it to 16.30 won't work.

        The problem may be that you've put the code in a place where it won't be displayed. As always an URL would help so we can see.

        Try adding some normal text (I've also fixed your 16.30 requirement) e.g.

        Code:
        Can you see this
        <script language=JavaScript>
        <!--
        now = new Date();
        if ( (now.getHours() >= 17) || ( (now.getHours() == 16) && (now.getMinutes() >= 30) ) ) 
          {
          document.write('<font color=red>Warning text here</font>');
          }
        //-->
        </script>
        and this.
        Finally, all this depends on your clients having their PC's clocks set correctly.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          I've been editing this while you posted a reply. So it would be best to revisit my posting above.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            sorry url is www.mp3playersonline.co.uk

            Comment


              #7
              It's working fine. I see the message below BASKET DETAILS (only if I set my system clock past 4:30).
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Great it works,

                Thanks

                Comment


                  #9
                  is there a way of making it show a different message on saturdays and sundays.

                  ie. "your order will not ship untill Monday for delivery on tuesday"??

                  Comment


                    #10
                    Jam on it, eh! Use the getDay() function which returns 0 .. 6 (Sunday .. Saturday).
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment

                    Working...
                    X