Adding A Delivery Date

By | March 10, 2008

Over in the official osCommerce Forum, someone wanted the ability to add a “delivery date” that the customer can choose to select.

I have no doubt that there is a pre-existing contribution that can handle this, bt I thought it would make an interesting exercise, to see if I could come up with something that is coded cleanly and, most importantly, works easily…

Introducing the Club osCommerce Date Picker!

This little mod took me about 15 minutes work. I added a text input using javascript on the checkout_shipping page, and created the value as a session. I input the session value into the database. Then pull the value from the database to display the customer preferred delivery date in the Admin area.

Here’s a short video showing this;

If anyone wants the code, please let me know – it does involve some changes to core osCommerce files (though the changes are very minimal. If anyone wants it, I’ll package it up ready for download.

42 thoughts on “Adding A Delivery Date

  1. Barbara Fena

    Hello
    I could really use that script if you would be so generous as to share it. My shopping cart is very modified, but that feature is very needed. Thank you so much for the help.

  2. Rob Lancaster

    Hi, This might be just what I need for a florist site. Can you send it to me please

  3. Rob Lancaster

    Gary,
    Thanks for pointing me to the download. I have your Delivery Date picker installed at my site. It works well!

    Just a couple of more questions.

    1. How do I change the resulting field date format from 2009-01-20 to 20-01-2009?

    2. How do I change the date picker so that Saturdays are selectable for delivery?

    3. Is there any way I can exclude specific delivery dates such as public holidays?

    Regards,

    Rob

  4. Ruth

    Hi,

    I have installed your Delivery date to my site but currently the calender is not appearing upon mouse-over or even which I clicked on the input box.

    Do you have any idea what I can do to solve that?

    With Regards,
    Ruth

  5. Gary Post author

    Hi Ruth

    Incorrectly installed, or you have javascript turned off in your browser.

    Cheers, Gary

  6. sam

    I have a cre loaded website, will your shipping date chooser work with cre loaded sites? If so, please send me your Date picker add on. Thanks.

  7. Gary Post author

    Sam;

    1. don’t know
    2. download at the oscommerce contributions area

  8. Trevor Hunt

    I’d GREATLY appreciate the source code for this. I need something that is compatible with my current OS Commerce site, V2.2 RC2 and I think this is it.

    Thanks!

  9. Gary Post author

    Shankar – download at the oscommerce contributions area – if you need help with installation or changing the codebase, please email me on oscshops@gmail.com and I will be happy to quote you.

  10. radek

    hello

    What I have to do to make this script work with paypal? the problem is that it does not forward the delivery date in to date base when I use the paypal module?

  11. Gary Post author

    Radek; Any payment script that bypasses checkout_process.php (eg the paypal scripts) would need to have similar changes made to them as what is made to the checkout_process file.

  12. Jean

    Hi, nice script.
    I have two questions.
    1.) How I can alter the code that I can also select Saturday and Sunday on the date picker?
    2.) Is there a ability to check if the user has entered a date?
    Sorry for my bad english… I’m still learning.

    Thanks!

  13. Gary Post author

    Hi Jean

    1. Take out the “noweekends” line of code from checkout_shipping
    2. Have some type of “flag” on checkout_payment to deal with that – if blank redirect to checkout_shipping. OR, find a javascript that’ll do it – http://www.sitepoint.com/forums/showthread.php?t=633251 (quick example found in google).

  14. Jean

    Thanks a lot!
    I have only a problem with point 2. Where i find the flag in checkout_shipping?

  15. Gary Post author

    Hi Jean – that does not exist, you would need to create it.

  16. Rod S.

    I am developing a osCommerce shop with version 2.3.1
    I have installed the delivery date scripts that you have developed and when I have the Redmond Theme installed it works perfectly.
    However if I change themes (using Theme Switcher v1.1) to one of the other “standard” ones like Le Frog the drop down portion of the Calendar no longer works.

    Anyone have any suggestions?

  17. Gary Post author

    I haven’t tested it with any other themes. If you find the answer please post back. Thanks.

  18. Mike

    SELECT WEEKENDS!!

    Edit line 203 code in “checkout_shipping.php”

    from ( beforeShowDay: $.datepicker.noWeekends )

    to ( beforeShowDay: $.datepicker.Weekends )

    Just remove the “no” in “noWeekends”, Thats it!!!

  19. Gary Post author

    Better to remove the line entirely…

  20. Mike

    How do you change “Preferred Delivery Date” and “Please choose your preferred delivery date.” Text?

  21. James

    Hi

    This is a brilliant contribution.
    is it possible to display the calendar for only specific products

    thanks in advance

  22. Gary Post author

    Yes, that would be possible to show the calendar based on products in the cart. WOuld take some extra coding, but is doable.

  23. james

    hi gary

    thanks for the response. my php is ok but im not entirely sure how to do it. could i do it based on the delivery variable that i have created. eg, if next day, display calendar etc…

    also im using google checkout, does anything need to be modified in these files to make this contrib work

    thanks in advance

  24. Gary Post author

    You could do that. If google checkout is coded correctly it should work OK with any modification.

  25. Neil Hesman

    I have added the delivery date chooser, which seems to work really well thank you. I have one minor problem in that the delivery date isn’t shown on the confirmation email. I have modified the checkout_process.php file to match the one in the contribution, but still no joy. Any suggestions will be welcome.

  26. Gary Post author

    I think I did not add it to the email. You need to (as you know) amend checkout_process.php.
    Note that some payment methods bypass this page and do that process themselves (eg paypal)

  27. Gabriel Zapata

    Hello,
    I have a 2.3.1 version, install date of delivery, but not work. I select date but the administrator does not show and when I check the database table that stores delivery_date ORDER_ID: 0000-00-00 00:00:00
    Not shown in the email.

    I want to know how to solve the problem or if you have any charge for proper installation.

    View screenshots.
    http://www.alternativascreativas.com/clientes/hojasblancas/copia/admin_DS_Club.png

    http://www.alternativascreativas.com/clientes/hojasblancas/copia/db_SD_Club.png

    Thank you!

  28. Gary Post author

    If it’s not going into the database, then nothing would show in the admin. So the question is “why not going into the database”. Make sure that you have correctly installed and if you need help please email me direct and I can quote you.

  29. Dexter

    Hi, Ive got the paypal payment method installed, I understand that the email wont include the preferred delivery date but it appears to be not saving anything in the database once the user selects paypal as the payment option. If they select return to merchant nothing is saved either. Im not certain what needs to be done or what needs to be changed but any help (or pointers) would help for sure! Thanks!

  30. Gary Post author

    Some paypal modules have their own version of the checkout_process so any changes in the checkout_process need also to be made in the paypal modules. Hope this helps;

    Did you also see my latest post which would be perfect for a flower seller.

  31. Nick TheMonkey Fitton

    Hey Gary,

    Ive installed your date picker, which works fantastic, only thing is it isn’t displayed anywhere except from the order page, you select the order, there it is, but its not on the invoice and I’m failing to get it to display in the coloumn.
    Any hints or tips would be appreciated

    Thanks

    Nick

  32. fahmeeda

    Hi, I am having the same issue… Did you manage to solve it? Can you help me?

  33. oscbooks

    You’d need to grab the code from the order page and use it as a basis in the invoice page. If you need a quote on that, get in touch.

  34. Shahul

    Hi, Date picker works fine. But how can i make it compulsory to choose the date? so that the order will process if not it shuld redirect to the checkout page?

  35. Gary

    You could use javascript to read if an entry is there and if not, not to process the form (and show a error message). If you need a quote for that, get in touch.

Leave a Reply

Your email address will not be published. Required fields are marked *