Quote Originally Posted by mrmeech View Post
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):
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 -->
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

$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 -->
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.

Let me know if this works for ya..

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