mrmeech,
Thank you for this contribution it is exactly what I was looking for. Installation went well although I did make a few changes to integrate with Ty's tracking module.
Thanks again!!![]()
mrmeech,
Thank you for this contribution it is exactly what I was looking for. Installation went well although I did make a few changes to integrate with Ty's tracking module.
Thanks again!!![]()
CONTRIBUTIONS:
- ORDER DELIVERY DATE: http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=976
This is a great addition! Thank you.
I have one question though. the site I'm working on offers same day delivery if they order before 10am. Is there any way that I can have it not have today's date listed after 10 am???
I just wrote some code for ya - Open up /includes/templates/YOURTEMPLATE/templates/tpl_checkout_shipping_default.php
Find this code (it's near the bottom):
And replace it with this:Code:<!-- Bof Ship Date --> <fieldset class="shipping" id="order_delivery_date"> <legend><?php echo TABLE_HEADING_DELIVERY_DATE; ?></legend> <select name="order_delivery_date"> <?php for ($i=0, $n=50; $i < $n; $i++) { $now[$i] = strtotime ("+$i day", time()); if ( strftime ("%w",$now[$i])<>0 AND strftime ("%m-%d",$now[$i])<>"12-25" AND strftime ("%m-%d",$now[$i])<>"12-26" AND strftime ("%m-%d",$now[$i])<>"01-01" ){ echo '<option value="'.strftime ("%Y-%m-%d",$now[$i]).'">'.strftime ("%A %d %B %Y",$now[$i]).'</option>'; } } ?> </select> </fieldset> <!-- Eof Ship Date -->
Change $display_current_time to true to see if the time output by the server/browser matches your time zone, and then adjust $time_zone_adjust as needed.Code:<!-- Bof Ship Date --> <fieldset class="shipping" id="order_delivery_date"> <legend><?php echo TABLE_HEADING_DELIVERY_DATE; ?></legend> <select name="order_delivery_date"> <?php $current_time = (date("h:ia")); $current_hour = (date("H")); // 24 hour time as two digits $begin_cutoff_hour = '10'; // set on a 24 hour time clock $end_cutoff_hour = '19'; // set on a 24 basis - "19" would be 7pm $time_zone_adjust = '0'; // use this to adjust your hour value forward or backwards $display_current_time = false; // Chage to "true" to check your system time for adjustments to $time_zone_adjust. Result will be echo'd to browser below ship date dropdown menu $current_adjusted_hour = ($current_hour + $time_zone_adjust); if($current_adjusted_hour <= $begin_cutoff_hour) { $date_offset = '0'; } else { $date_offset = '1'; } for ($i=$date_offset, $n=50; $i < $n; $i++) { $now[$i] = strtotime ("+$i day", time()); if ( strftime ("%w",$now[$i])<>0 AND strftime ("%m-%d",$now[$i])<>"12-25" AND strftime ("%m-%d",$now[$i])<>"12-26" AND strftime ("%m-%d",$now[$i])<>"01-01" ){ echo '<option value="'.strftime ("%Y-%m-%d",$now[$i]).'">'.strftime ("%A %d %B %Y",$now[$i]).'</option>'; } } ?> </select> </fieldset> <?PHP if ($display_current_time == true) { echo "YOUR SYSTEM TIME IS $current_time"; } ?> <!-- Eof Ship Date -->
Let me know if this works for ya..
Last edited by mrmeech; 8 Apr 2008 at 11:38 PM.
Thank you so much! It seems to be working great so far. I will test it tomorrow morning just to be sure. You are a life saver!
Hi mrmeech,
Don't mean to be a pest but I think I broke something on my install of this mod and maybe you can direct me to a fix.
In an effort to change the display of the ship date I changed the code in the
/includes/templates/YOURTEMPLATE/templates/tpl_checkout_shipping_default.php
file.
On the line to print the date I changed the order of Y , m, d to m, d, Y. It seemed to work fine, at least it shows the correct date order in the drop down at check out and displays the correct date order on the confirmation page as well. I also made this change in the emails and it displays properly there too.
But now I'm getting the date of 11/30/1999 in the orders list on the admin side for all orders, regardless of date selected. Could you guide me to what I need to correct?? And since I'm NOT a programmer, perhaps my approach is completely wrong.![]()
Well, changing that line of code can actually cause it to be inserted into the database record incorrectly, so it doesn't surprise me that you would wind up with something awkward happening. You could have also broken the date array that generates the list of dates... anyway, do some reading here if you're interested in learning about dates and mysql databases (i'm a strong encourager of learning): http://www.tizag.com/mysqlTutorial/mysql-date.php
What is it exactly that you want to do? Have the dropdown display the year at the end instead of the beginning of each date value?
I know this mod has been updated since this post but just wondering whether there was anyway around setting cut-off time for ordering e.g. if order place before 10am then delivery is 24hrs from then if after 10am is 48 hrs. hopefully someone has some ideas on this thanks![]()
I have tried installing Carola's mootools fix but am still unable to see the calendar in IE9, and worse the empty box that does display does not allow text to be inserted. I assume this could be a conflict with other jscripts, but would really like to know if there is likely to be a mod upgrade or fix that does work coming out?
It displays fine in IE8 and earlier, but not in IE9 which according to my stats more and more people have upgraded too.
If there is a way of making the default text box accessible if the date picker is not working I would appreciate knowing what to turn on or off.
I won't say what I think about IE9, but this is a great tool in Chrome, FF and older IE browsers (and you can't say that often).
Hi All
I am using this mod with 1.3.9h and if a customer does not select a delivery date I get Tuesday 30 November, 1999 this as the date on the invoice. Any ideas anybody. thought perhaps I may not have my localtime set up properly???![]()