Adding A Delivery Date

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.





Hello, I need the code. I appreciate if you could help me
Best
Comment by Nurlan — October 25, 2008 @ 11:05 pm
Nurlan – here.
Comment by Gary — October 27, 2008 @ 8:57 am
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.
Comment by Barbara Fena — December 3, 2008 @ 5:59 am
Hi, This might be just what I need for a florist site. Can you send it to me please
Comment by Rob Lancaster — January 16, 2009 @ 10:55 am
http://addons.oscommerce.com/info/6178
Comment by Gary — January 16, 2009 @ 11:58 am
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
Comment by Rob Lancaster — January 20, 2009 @ 4:34 am
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
Comment by Ruth — October 15, 2009 @ 3:04 am
Hi Ruth
Incorrectly installed, or you have javascript turned off in your browser.
Cheers, Gary
Comment by Gary — October 15, 2009 @ 11:47 am
Please, could you send it me to me please?
Comment by Martin — October 18, 2009 @ 3:58 pm
Hi Martin – download from http://addons.oscommerce.com/info/6178
Comment by Gary — October 26, 2009 @ 6:26 pm
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.
Comment by sam — December 5, 2009 @ 8:02 am
Sam;
1. don't know
2. download at the oscommerce contributions area
Comment by Gary — December 5, 2009 @ 11:16 am
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!
Comment by Trevor Hunt — January 26, 2010 @ 4:02 am
Hi, This might be just what I need for a florist site. Can you send it to me please
Comment by Shankar — February 8, 2010 @ 7:25 am
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.
Comment by Gary — February 8, 2010 @ 2:54 pm
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?
Comment by radek — September 30, 2010 @ 10:32 pm
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.
Comment by Gary — October 8, 2010 @ 9:39 am
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!
Comment by Jean — October 11, 2010 @ 6:33 pm
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).
Comment by Gary — October 12, 2010 @ 8:02 am
Thanks a lot!
I have only a problem with point 2. Where i find the flag in checkout_shipping?
Comment by Jean — October 12, 2010 @ 11:39 am
Hi Jean – that does not exist, you would need to create it.
Comment by Gary — October 12, 2010 @ 11:43 am
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?
Comment by Rod S. — March 1, 2011 @ 11:19 pm
I haven't tested it with any other themes. If you find the answer please post back. Thanks.
Comment by Gary — March 2, 2011 @ 9:42 am
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!!!
Comment by Mike — June 1, 2011 @ 8:42 am
Better to remove the line entirely…
Comment by Gary — June 2, 2011 @ 8:38 am
How do you change "Preferred Delivery Date" and "Please choose your preferred delivery date." Text?
Comment by Mike — June 3, 2011 @ 1:45 am
Mike in the language files.
Comment by Gary — June 3, 2011 @ 9:44 am
Hi
This is a brilliant contribution.
is it possible to display the calendar for only specific products
thanks in advance
Comment by James — September 26, 2011 @ 8:16 am
Yes, that would be possible to show the calendar based on products in the cart. WOuld take some extra coding, but is doable.
Comment by Gary — September 26, 2011 @ 8:30 am
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
Comment by james — September 26, 2011 @ 9:00 am
You could do that. If google checkout is coded correctly it should work OK with any modification.
Comment by Gary — September 28, 2011 @ 1:22 pm
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.
Comment by Neil Hesman — November 23, 2011 @ 12:57 pm
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)
Comment by Gary — November 25, 2011 @ 10:23 am
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!
Comment by Gabriel Zapata — December 29, 2011 @ 7:03 pm
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.
Comment by Gary — January 19, 2012 @ 12:52 pm