Thread: Date attribute

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Date attribute

    I have a florist client who would like to have her customers be able to select a delivery date from a calendar. She would like to be able to black out Sundays and certain other dates she is either closed, or oversold.
    Is there a mod that includes these functions?

  2. #2
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: Date attribute

    I have heard this sort of request before, but I am not aware of a drop in mod that covers it. The Admin uses the "Spiffy Cal" for setting dates for specials etc. Perhaps you could adapt it?

  3. #3
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Date attribute

    Quote Originally Posted by TecBrat
    I have a florist client who would like to have her customers be able to select a delivery date from a calendar. She would like to be able to black out Sundays and certain other dates she is either closed, or oversold.
    Is there a mod that includes these functions?
    I ended up hard coding some java into the checkout process that adds date and time to the order comments. I then made the comment box read-only on the next page. If this is of great interest to someone, contact me and I will try to assist. (This was on an old version of the cart that was made without overrides, so I can't {or really don't want to} upgrade it.)

  4. #4

    Default Re: Date attribute

    I would love to know how you did that.
    This is the zencart I am currently working on.
    http://www.memphisriverboats.net/cart
    ZC v. 1.3.6
    Super Orders

  5. #5
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Date attribute

    Quote Originally Posted by violetcandy
    I would love to know how you did that.
    Just acknowledging I read this. I am on the job at the moment, but after work, I'll try to put something together that makes it easy to understand what I did. I have not practiced making documentation for others to read very much.

  6. #6
    Join Date
    Sep 2006
    Posts
    17
    Plugin Contributions
    0

    Default Re: Date attribute

    i developed a nice module for selecting delivery time for OSC.
    http://www.oscommerce.com/community/contributions,4530
    if anyone can make it work with ZEN, well, it would be lovely!!

    maybe this could help!
    http://www.zen-cart.com/wiki/index.p...dules_from_osC

    ciao!

  7. #7
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Date attribute

    Quote Originally Posted by TecBrat
    Just acknowledging I read this. I am on the job at the moment...
    Sorry I haven't had the chance to come back and give the details, or to check out the oscart mod. I want to help, but I find myself so busy that I can't write this up. I haven't given up on it though.

  8. #8
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Date attribute

    I wrote this out in notepad.
    I am going to put it all in a code box in case code might otherwise cause problems in the board. just rip out what you need.
    I am sure this is very much against any form of standards that exist, but it worked.
    Code:
    NOTE: THIS IS FROM AN OLD VERSION OF THE CART, AND IS NOT USING OVERRIDE. 
    USE CAUTION AND BACKUP, BACKUP, BACKUP.
    
    in tpl_checkout_shipping_default.php make these changes:
    
    first, change the form action. You'll have to append the zenid to it. the javascript function mycheckrequired() is defind in scw.js I downloaded it somewhere, and added it to the simple calendar widget I also downloaded.
    $myquerystring="?main_page=checkout_shipping&$_GET[zenid]";
    <form onSubmit="return mycheckrequired(this)" name="checkout_address" action="https://secure.mysite.net/~myclient/index.php<?echo($myquerystring);?>" method="post" >
    ** takes the place of **
    echo zen_draw_form('checkout_address', zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . zen_draw_hidden_field('action', 'process');
    
    next we'll write our own form fields. 
    ** replace **
    php echo zen_draw_textarea_field('comments', 'soft', '60', '5');
    ** with**
     <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber4">
    	              <tr>
    	                <td width="100%">
    	                <script type='text/JavaScript' src='scw.js'></script>
    	                <input type=hidden  name="comments">
    	                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber5">
    	                  <tr>
    	                    <td width="50%">
    
    	              <img src='https://secure.mysite.net/~myclient/images/scw.gif'
    	              title='Click Here'
    	              alt='Click Here'
    	              onclick="scwShow(document.getElementById('date1'),this,0,6);" width="16" height="16" align="right" /><font face="Verdana" style="font-size: 9pt">Select
    	              a Date:</font></td>
    	                    <td width="50%"><input required onclick="scwShow(this,this,0,6);" readonly id='date1' type="text" name="requiredmycdate" size="20"></td>
    	                  </tr>
    	                  <tr>
    	                    <td width="50%">
                            <font face="Verdana" style="font-size: 9pt">Enter a Time:</font></td>
    	                    <td width="50%">
    	                    <select name=requiredmyctime size="1" >
    							<option value= "">Please select the earliest we may deliver.</option>
    							<option value= "9:00am">9:00am</option>
    							<option value= "10:00am">10:00am</option>
    							<option value= "11:00am">11:00am</option>
    	                    </select><br>
    
    	                    <select name=requiredmyctime2 size="1" >
    							<option value= "">Please select the latest we may deliver</option>
    							<option value= "3:00pm">3:00pm</option>
    							<option value= "4:00pm">4:00pm</option>
    							<option value= "5:00pm">5:00pm</option>
    	                    </select>
    	                    </td>
    	                  </tr>
    	                  <tr>
    	                    <td width="50%" valign="top"><font face="Verdana" style="font-size: 9pt">Please Enter Comments:</font></td>
    	                    <td width="50%">
    	                    <textarea cols="60" rows="5" id='myccomments' name="myccomments" ></textarea></td>
    	                  </tr>
    	                  <tr>
    	                    <td width="100%" colspan="2">
    	                    <p align="center">
    	              </td>
    	                  </tr>
    	                </table>
    	                </td>
    	              </tr>
                </table>
    ** replace **
    <?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE, BUTTON_CONTINUE_ALT); ?>
    ** with **
    <?//[[Pickup/Delivery]] below is str_replace()ed in tpl_checkout_payment.php?>
        <input type="image" src="https://secure.mysite.net/~myclient/includes/templates/template_default/buttons/english/button_continue.gif"
           onclick="comments.value=('[[Pickup/Delivery]] Date ' + requiredmycdate.value + '\n[[Pickup/Delivery]] Begin Time: ' + requiredmyctime.value + ' End Time: '+requiredmyctime2.value+'\n[[Pickup/Delivery]] will be made between the selected times.\n' + myccomments.value)"
           alt="Continue" title=" Continue " width="75" height="20" />
    ==========
    since I don't remember where I got the "check required" code, I will include the entire function here with my alterations.
    i am re-modifying this to remove client specific info, but it should still work as I made corresponding changes to the code above.
    Like I said earlier, I just dropped this into the bottom of the other js file I was already useing.
    
    function mycheckrequired(which) {
    var mypass=true;
    if (document.images) {
    for (i=0;i<which.length;i++) {
    var tempobj=which.elements[i];
    if (tempobj.name.substring(0,8)=="required") {
    if (((tempobj.type=="text"||tempobj.type=="textarea")&&
    tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
    tempobj.selectedIndex==0)) {
    mypass=false;
    break;
             }
          }
       }
    }
    if (!mypass) {
    shortFieldName=tempobj.name.substring(11,30).toUpperCase(); 
    alert("Please make sure the "+shortFieldName+" field was properly completed.");
    return false;
    }
    else
    return true;
    }
    ==========
    
    ** find on google **
    //      Simple Calendar Widget - Cross-Browser Javascript pop-up calendar.
    //
    //   Copyright (C) 2005-2006  Anthony Garrett
    //
    //   This library is free software; you can redistribute it and/or
    //   modify it under the terms of the GNU Lesser General Public
    //   License as published by the Free Software Foundation; either
    //   version 2.1 of the License, or (at your option) any later version. ...
    
    ** near the top you'll find **
        var scwDateNow = new Date(Date.parse(new Date().toDateString()));
    ** add **
        var yesterday = new Date()-86400000;
    
    ** set these vars **
         var scwBaseYear        = scwDateNow.getFullYear();
        // How many years do want to be valid and to show in the drop-down list?
        var scwDropDownYears   = 2;
    
    ** paste this near the disable date code **
          <?PHP
          $deadline=11; // use 24 hour clock, 100th min time so 1:30pm is 13.5
          $deadline=$deadline*60;
    	  	        $t=time();
    	  	        $h=date("H",$t)+1; //server time is one hour behind my local time.
    	  	        $m=date("i",$t)+($h*60);
    	  	        $dlmet=($m<$deadline); //dlmet is short for deadline met.
    	  	    if ($dlmet){
    
    	  	    print('scwDisabledDates[0] = [new Date(2004,11,25),new Date(yesterday)]; ');
    	  	    }
    	  	    else{print('scwDisabledDates[0] = [new Date(2004,11,25),new Date()]; ');}
    // disables all dates from 2004,11,25 to yesterday or today
    	  ?>
    ** and make this changes as well: **
    	     var scwActiveToday = <?php print "'".$dlmet."'"; ?>;
    	    //var scwActiveToday = true;
                     //sets the "today" link active if deadline is met or inactive if not.
    
    ** read through Anthony Garrett's code to see if there are any other changes you need. **
    
    
    ** in tpl_checkout_payment_default.php **
    ** put this right below the zen comments **
    $mycshipmthd=$order->info['shipping_method'];
    $mycstorepickup="(Store Pickup)";
    if (ereg($mycstorepickup,$mycshipmthd)){$pu_dlv="Pickup";}else{$pu_dlv="Delivery";}
    $comments=str_replace('[[Pickup/Delivery]]',$pu_dlv,$comments);
    
    ** around line 220 change **
    echo zen_draw_textarea_field('comments', 'soft', '60', '5');
    ** to **
        
        <?echo("This area is read-only. Please <a href='javascript:history.go(-1);'><font style='color: red;'>go back</font></a> if corrections are needed.");?>
        <?
         echo zen_draw_textarea_field('comments', 'soft', '60', '5', '','readonly');
        ?>
        </td>
    
    I think this is all. I hope it is helpful.

  9. #9
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Date attribute

    Quote Originally Posted by TecBrat
    ** in tpl_checkout_payment_default.php **
    ** put this right below the zen comments **
    $mycshipmthd=$order->info['shipping_method'];
    $mycstorepickup="(Store Pickup)";
    if (ereg($mycstorepickup,$mycshipmthd)){$pu_dlv="Pickup";}else{$pu_dlv="Delivery";}
    $comments=str_replace('[[Pickup/Delivery]]',$pu_dlv,$comments);
    In the section above, there is a custom shipping mod called "Delivery" that I don't remember where it came from. My boss added it to this cart before I came to work for him. He might even have made it himself. Edit as needed for your own shipping choices.

  10. #10
    Join Date
    Feb 2005
    Posts
    246
    Plugin Contributions
    0

    Default Re: Date attribute

    I have taken this concept and moved it into the tp_checkout_payment_default.php file. It works better because the delivery choice has already been made, and I needed to offer a different kind of schedule for pickups than for delivery.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. order delivery date addon - date not showing in checkout
    By jagall in forum Addon Shipping Modules
    Replies: 4
    Last Post: 19 Oct 2017, 09:09 PM
  2. Date Attribute
    By stevearinsal in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 6 Mar 2011, 07:36 PM
  3. Easy Populate and the Date added updated to todays date issue.
    By cyphercys in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 9 Mar 2010, 04:26 AM
  4. attribute set for date
    By Phil020782 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 17 Feb 2008, 12:10 PM
  5. How can I display attribute selections side by side? ie: date fields
    By aaelghat in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 23 Mar 2007, 06:56 PM

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