Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2012
    Location
    Australia
    Posts
    2
    Plugin Contributions
    0

    Default Delivery Calendar

    Hi, I'm writing code to display a delivery calendar. I've modified the tpl_checkout_shipping_default.php file.

    Below is the modified section of code:

    PHP Code:
    <?php $week '<table cellpadding="0" cellspacing="0" class="week">';
      
    $headings = array(date("D, d/m"));
        for(
    $d=1$d<7$d++){
          
    $day mktime(000date("m"), date("d")+$d);
          
    array_push($headingsdate("D, d/m"$day));
          }
      
    $times = array('09:30-10:30','10:30-11:30','11:30-12:30','12:30-13:30','13:30-14:30','14:30-15:30','15:30-16:30','16:30-17:30','17:30-18:30','18:30-19:30','19:30-20:30','20:30-21:30');
      
    $week.= '<tr class="week-row-time"><td class="week-time-np">Deliver between the following times:</td><td class="week-day-head">'.implode('</td><td class="week-day-head">',$headings).'</td></tr>';
      for(
    $i=0$n=sizeof($times); $i<$n$i++){
        
    $week.='<tr class="week-row-time"><td class="row-time">'.$times[$i].'</td>';
        for(
    $j=0$m=sizeof($headings); $j<$m$j++){
          foreach(
    $quotes as $q1) {
            foreach(
    $q1['methods'] as $q2) {
          if(
    substr($q2['title'],0,5)==substr($headings[$j],5,5) && (mktime(0,0,0,substr($q2['title'],6,2),substr($q2['title'],9,2))<=mktime(0,0,0,substr($times[$i],6,2),substr($times[$i],9,2)) && mktime(0,0,0,substr($q2['title'],6,2),substr($q2['title'],9,2))>mktime(0,0,0,substr($times[$i],0,2),substr($times[$i],3,2)))) {
            
    $week.='<td class="week-time"><center>'.zen_draw_radio_field('shipping'$q1['id'] . '_' $q2[$j]['id'], $checked'id="ship-'.$q1['id'] . '-' str_replace(' ''-'$q2[$j]['id']) .'"').'<label for="ship-'.$quotes[$i]['id'].'-'.str_replace(' ''-'$q2[$j]['id']).'" class="checkboxLabel" >'.substr($q2['title'],12,30).'</label></center></td>';
            }
            else {
              
    $week.='<td class="week-time"><center>N/A</center></td>';
              }
              }
            }
          }
        
    $week.='</tr>';
        }
      
    $week.='</table>';
      echo 
    $week;
      
    ?>
    I'm having trouble with the looping, as it is making too many columns and I can't see what is wrong with the code. Any suggestions would be welcome.

  2. #2
    Join Date
    Jul 2010
    Posts
    27
    Plugin Contributions
    0

    Default Re: Delivery Calendar

    Are you looking for something time based? I have something on my site which gives them the opportunity to pick a time, based on the time it is. For example, we are open 7P-3A, anytime we are closed, they can pick a time from 7:30P-2:30A, in half hour increments. Once we open, the first available time is 8:30P, as it only displays a time slot if it is at least 1 hour away.

    We are a local delivery service.

 

 

Similar Threads

  1. Per Item - But different prices for 1 day delivery, 3 day delivery etc.
    By rowby in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Nov 2010, 10:25 PM
  2. Free Delivery Coupon still adding VAT/TAX for delivery
    By PudzPud in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 12 Oct 2009, 08:57 AM
  3. Problem with calendar: "desired delivery date"
    By cjacin75 in forum General Questions
    Replies: 1
    Last Post: 20 Dec 2008, 09:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg