Announcement

Collapse
No announcement yet.

Displaying delivery dates

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

    Displaying delivery dates

    Whilst looking at some competitor products on the woolworths site I really liked the information about delivery showing against the product above the add to basket button

    see here

    I have searched on the forum to see if anyone else was doing anything similar but I couldn't find anything - although I was unsure what terminology to use for searching so often got info on delivery dates and how to display a date etc.

    I can work out how to display the text but don't really have a clue how to get it to display a date that is say todays date plus 5 for example. Also I thought I could have a link saying need it quicker choose our express options as many people don't read the delivery options and call to ask if we can get it there tomorrow etc.

    Just wondered if anyone had any views or could point me in the right direction.

    Cheers

    D
    Donna

    Chief bunting supplier to Take That!

    #2
    If i wanted something similar, i'd expect to use JavaScript. I'd be amazed if there wasn't many scripts out there to do this for you already. They may need a minor tweak but that would be my first port of call.

    Search the web on 'JavaScript Delivery Dates' and see where that gets you.

    Comment


      #3
      Thanks Lee, I'll see where I get with it and if I find something I'll post back here.

      Cheers

      D
      Donna

      Chief bunting supplier to Take That!

      Comment


        #4
        Hi

        I've managed so far to produce the following piece of code:

        Our standard delivery is £2.95. <br>Delivery for this item will be on or before:<b>
        <script type="text/javascript">
        var myDate=new Date;
        myDate.setDate(myDate.getDate()+4);
        document.write(myDate)</script></b>.<br>
        Need it quicker? Choose one of our express options during checkout
        Which does (nearly!) what I want it to do.

        it displays as follows:

        Our standard delivery is £2.95. <br>Delivery for this item will be on or before Fri 1st Feb 16:11:55 UTC 2008
        Need it quicker? Choose one of our express options during checkout
        The first problem is this displays the date including the time which looks daft. I can't find a way to display just the date. I've tried using day month year parameters but I get confused with the add 5 days then - is there a way I can get this script to cut off the time element?

        My next task is to find out how to add only business days but I have read some threads on possible ways to do that so I'm hopefully getting there with that bit!

        Cheers

        D
        Donna

        Chief bunting supplier to Take That!

        Comment


          #5
          Try
          Code:
          <script type="text/javascript"> 
          <!--
          var myDate=new Date();
          myDate.setDate(myDate.getDate()+4);
          document.write(['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][myDate.getDay()]);
          document.write(' ' + myDate.getDate() + ' ');
          document.write(['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][myDate.getMonth()]);
          // -->
          </script>
          You could use the myDate.getDay() which returns 0 .. 6 (Sun .. Sat) to determine how many days to add.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Well done for having a go Donna, that's really good so far, i'm impressed - i really suck at Javascript. I daresay your effort on this might also be a factor in Norman jumping in and helping.

            Comment


              #7
              Thanks Norman, that works brilliantly, was getting in such a mess yesterday with my getMonth getDay +4

              I have read some notes on using business days so that's my next feat to try and work out how to get it to count only working days to avoid saying Sat and Sun del dates but inititally I can manipulate the +4 so that it works.

              Thanks Lee, I surprised myself when I got it to work I am trying to understand more but my underlying fear is that I will break something and won't be able to fix it so I'm always relucatant to try!! Also, when it's all new to you you don't know where to start. I wouldn't have had a clue that javascript was the way to go. I was reading a thread on here yesterday about people 'expecting answers' and I think that it is really easy to fall into that trap. 'I'm scared I might break something, I know, I'll ask the forum' is so much easier than trying first and saying I've got this far. Anyway my New Years resolution is to read a couple of dummies guides. You never know my java could end up better than yours!! ok maybe not

              I'll post url when I've got it live and will update re working days scenario. At the moment I am looking to have it in the product near the add to cart button but may also put in the checkout phase if possible. So many of our customers don't read our delivery information or our express options and call I wonder how many just don't bother to buy at all.

              Anway ramble over (sorry) and thanks again to Norman and Lee for your help so far.

              D
              Donna

              Chief bunting supplier to Take That!

              Comment


                #8
                I was reading a thread on here yesterday about people 'expecting answers' and I think that it is really easy to fall into that trap
                As Lee says well done for having a go and not expecting the easy answer.

                Comment


                  #9
                  Originally posted by Donna Kempster
                  You never know my java could end up better than yours!! ok maybe not
                  LOL it already is TRUST ME, i really suck at Javscript so bad, i have a great book i want to read on it, i just never seem to get the time. I will be contacting you to do some for me if you carry on at that rate.

                  Really well done though, i genuinely love to see people get stuck in, just remember if you have snapshotted before you go playing, you can always get back to where you was before - so relax on that part.

                  Comment


                    #10
                    Donna,

                    The line

                    myDate.setDate(myDate.getDate()+4);

                    can be replaced by

                    var daystodeliver = [4,4,4,4,4,4,4][myDate.getDay()];
                    myDate.setDate(myDate.getDate()+daystodeliver);

                    Now you can change that list of 4's to be the actual offset needed based on the day the order is placed. The list goes Sunday .... Saturday. So making the 1st item 6 would mean that orders received on a Sunday would take 6 days to arrive.
                    Norman - www.drillpine.biz
                    Edinburgh, U K / Bitez, Turkey

                    Comment


                      #11
                      Hi Norman

                      Thanks for this. I have been trying to work with the getDeliveryDateObj() function but have gone round in ever decreasing circles for the last few hours!

                      Your solution is so much easier to understand. I was having to generate millieseconds and then try and convert it back. My little brain couldn't cope!

                      Am beginning to understand how the Java thing works though so well worth all the brain ache.

                      Have some major redesign to do on site as adding some new lines so will publish url when released.

                      Thanks again. D
                      Donna

                      Chief bunting supplier to Take That!

                      Comment


                        #12
                        I've looked at this before, there are in fact Delivery Date scripts already available on the interweb for free download & use. (I didn't implement though for various reasons).

                        But may I just ask - presumably the result of this script displayed on the web page changes at midnight when the date changes?

                        So place an order (say Monday) evening, it would say 'Delivery 3 days = Thursday' and place an order at 5am Tues. it would say '3 days = Friday' yet both orders would be downloaded and processed on the same day (Tuesday + 3 days = Friday).

                        Would it be possible for it to change at a specific time of day, on the basis that anything ordered overnight or in the morning, could in fact be shipped the same day?

                        (I hope this is food for thought. I ship 'Next-Day' so I can 'order Monday (up to cut-off time) deliver Tuesday'. But an order placed after cut-off time Monday could not be delivered Tuesday.)

                        Like some of Kermy's scripts in the past, this thread could run & run!
                        Paul
                        Flower-Stands.co.uk - the UK's largest online supplier of Fresh Flower Merchandising Stands

                        Using V10.2 with Norman's brilliantly simple TABBER.

                        Comment


                          #13
                          Code:
                          <script type="text/javascript"> 
                          <!--
                          var myDate=new Date();
                          if ( myDate.getHours() < 15 ) // less than 3pm
                            {
                            var daystodeliver = [4,4,4,4,4,4,4][myDate.getDay()];
                            }
                          else
                            {
                            var daystodeliver = [4,4,4,4,4,4,4][myDate.getDay()];
                            }
                          myDate.setDate(myDate.getDate()+daystodeliver);
                          document.write(['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][myDate.getDay()]);
                          document.write(' ' + myDate.getDate() + ' ');
                          document.write(['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'][myDate.getMonth()]);
                          // -->
                          </script>
                          Where the first set is the days to use if it's before 3pm and the second if after
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment


                            #14
                            Script now working online HERE.

                            Code for 'next-day' delivery if ordered before 3pm:
                            Code:
                            <span class="actxsmall">Anticipated Delivery Date: </span>
                            
                            <script type="text/javascript"> 
                            <!--
                            var myDate=new Date();
                            if ( myDate.getHours() < 15 ) // less than 3pm
                              {
                              var daystodeliver = [2,1,1,1,1,3,2][myDate.getDay()];
                              }
                            else
                              {
                              var daystodeliver = [2,2,2,2,2,4,3][myDate.getDay()];
                              }
                            myDate.setDate(myDate.getDate()+daystodeliver);
                            document.write(['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][myDate.getDay()]);
                            document.write(' ' + myDate.getDate() + ' ');
                            document.write(['January','February','March','April','May','June','July','August','September','October','November','December'][myDate.getMonth()]);
                            // -->
                            </script>
                            Reasoning: B43pm Sun = del Tues; B43 Mon = Tues .... B43 Fri = Mon; B43 Sat = Tues.

                            After 3pm Sun = del Tues; after3 Mon = Weds ... After3 Fri = Tues.

                            Dare I ask, what about Good Friday. Bank Holidays, Christmas shutdown......?
                            Paul
                            Flower-Stands.co.uk - the UK's largest online supplier of Fresh Flower Merchandising Stands

                            Using V10.2 with Norman's brilliantly simple TABBER.

                            Comment


                              #15
                              Code:
                              Dare I ask, what about Good Friday. Bank Holidays, Christmas shutdown......?
                              Replace entire lump of JS by a nice block of text. Restore JS when the fun is over.

                              Paul,

                              Could you edit your post #14 above and use [ C O D E ] and [ / C O D E ] tags instead of the HTML Code ones as it's inserting unwanted breaks.
                              Norman - www.drillpine.biz
                              Edinburgh, U K / Bitez, Turkey

                              Comment

                              Working...
                              X