Re: Order Delivery Date Support Thread
MrMeech-
Thanks for your contribution is it awesome! One quick question and hopefully I didn't miss the answer in the midst of all the pages of this thread. How difficult is it for a customer to be able to select a delivery time as well as date? I have tried to figure this one out on my own with no luck.
Thanks again!
Re: Order Delivery Date Support Thread
MrMeech-
I would also like to thank you for this contribution. I too am having problems with allowing customers to select delivery times. What I am looking for is something as simple as a text box or drop down list along side or below the date. Also, if possible could the calender be included under a specific type of shipping module. Any help is greatly appreciated.
Thanks in advance,
Dave
Re: Order Delivery Date Support Thread
Hey,
I'm totally new to Zen-Cart. And I love your Order Delivery Date addon! It's God sent!
I've tried searching in the forum for a question I have in mind and most probably there's an answer somewhere in this forum. But I can't seem to find it. :dontgetit
Can someone please help?
Here's my question: When someone picks a date from the calendar, the default date setting is YYYY-MM-DD both in both the website and the emails sent. How can I change it to DD-MM-YYYY for both the website and email sent?
Thanks a million!
Re: Order Delivery Date Support Thread
I THINK this may help: (Make a backup first!)
In:-
includes/modules/pages/checkout_shipping
Open (in a suitable text/php editor)
jscript_calendar_head.php
Modify:
{ date: 'Y-m-d' } to { date: 'd-m-Y' }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
To get D-M-Y in your store, you need to modify the following sections in the english.php files in both your CATALOG and your ADMIN sections:
(This is the DEFAULT in a standard install of ZC and renders the date as M-D-Y)
PHP Code:
@setlocale(LC_TIME, 'en_US.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%m/%d/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'm/d/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
////
// Return date in raw format
// $date should be in format mm/dd/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 3, 2) . substr($date, 0, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 0, 2) . substr($date, 3, 2);
}
}
}
Look CAREFULLY at the above and apply the shown changes BELOW for UK-Styled D-M-Y format).
PHP Code:
@setlocale(LC_TIME, 'en_UK.ISO_8859-1');
define('DATE_FORMAT_SHORT', '%d/%m/%Y'); // this is used for strftime()
define('DATE_FORMAT_LONG', '%A %d %B, %Y'); // this is used for strftime()
define('DATE_FORMAT', 'd/m/Y'); // this is used for date()
define('DATE_TIME_FORMAT', DATE_FORMAT_SHORT . ' %H:%M:%S');
////
// Return date in raw format
// $date should be in format dd/mm/yyyy
// raw date is in format YYYYMMDD, or DDMMYYYY
if (!function_exists('zen_date_raw')) {
function zen_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
}
}
}
As there is no over-ride system in ADMIN, just edit/over-write the original english.php file.
For /includes/languages/english.php , you should save the edited copy to your custom folder.
IMPORTANT NOTE:
Lower down in english.php, there are additional date defines (such as date of birth define text) that indicate to the shopper, that the format is MDY. Find these and alter them so they indicate the date format to now be DMY
Re: Order Delivery Date Support Thread
Hey,
Thanks for the kind advice.
I've made ALL the changes as per your suggestion. But it didn't work. :(
Yes. I'm VERY VERY sure that I've made all the changes as per your suggestion.
Although it worked during the Step 1. By the time it reaches Step 3, the date shows 16 years ahead.
Eg: When I selected 25 Nov 2008 at Step 1, it would show as 25-11-2008. But at Step 3, the "Desired Delivery Date" became
Tuesday 08 October, 2024!
The funny thing is that when customers receive their email, the desired delivery date shows: 25-11-2008! :shocking:
I'm clueless. Please help.
I appreciate you.
Re: Order Delivery Date Support Thread
There could be another YMD to DMY setting somewhere in the javascript file.
See if you can find it.
You can contact the author of the script at:
http://electricprism.com/aeron/
Re: Order Delivery Date Support Thread
mrmeech,
I see that a few others were wondering along with me if you had per chance had the time to add a time select option to your wonderfully made calander. Thanks again for your work!
4 Attachment(s)
Re: Order Delivery Date Support Thread
Quote:
Originally Posted by
Child_Of_The_Mind
mrmeech,
I see that a few others were wondering along with me if you had per chance had the time to add a time select option to your wonderfully made calander. Thanks again for your work!
Friends!! A whole page and a half of responses happened and i didn't receive a notification of a new post until today!!! How that happend, i have no clue. But it's the truth!
Anyway, i DO have a variation with a time feature that will work, but is NOT implemented in the best way.
Here's the 2 cents of background on why the time part is little "ghetto-implemented": Basically when i went to do this i COULD NOT get the javascript to consistently merge the date with the time and have it insert into the database as a "datetime" record. I ran into huge problems with the fact that the zen's checkout uses css buttons combined with a function to call/create the "continue" button image. Additionally, when i went to use a pre-made date and time picker javascript object, i couldn't get that to work either. Forgive me!!
I will attach the package as is, which should work (provided you don't have any other checkout mods already installed). In it you will see commented out code from when i was feverishly trying to get a smooth datetime feature working.
You are going to have to add times to the array - currently there is just 12:30 and 1:30, and the format must be in 24-hour format. You'll see when you get there. You can find it on the includes/templates/YOUR_TEMPLATE/template/tpl_checkout_shipping_default.php. It's around line 140 and looks like this:
Code:
<!-- Bof Order Delivery Date -->
<fieldset class="shipping" id="delivery_date_details">
<legend><?php echo TABLE_HEADING_DELIVERY_DATE; ?></legend>
<label for="delivery_date_details">Date:</label>
<input readonly="readonly" id="date" name="order_delivery_date_day" type="text">
<select id="order_delivery_date_time" name="order_delivery_date_time">
<option value="">Select Delivery Time</option>
<option value="12:30:00">12:30pm</option>
<option value="13:30:00">1:30pm</option>
</select>
</fieldset>
THIS IS IMPORTANT:
BACK UP YOUR DATABASE FIRST!!!
If you have this installed already, you will need to alter the zen_orders table in the database. You *SHOULD* be able to just rename the row "order_deliver_date" to "order_delivery_date_day" and change the type from datetime to date. (I'm *pretty sure* this will preserve the date data, but don't hold me to it!) Then you need to add another row called "order_delivery_date_time" and make the type as just "time".
The SQL file is attached, which should work if you haven't installed the Mod yet at all.
And finally, KEEP THIS IN MIND: A number of months ago i read (i think) Ajeh's (who is a zen cart official) response to someone asking when the next version of zen cart (1.4) will be out, and the answer was basically some time before the end of december 2008 - WHICH IS VERY SOON (assuming they are still on track). Although not in their roadmap, it is likely that the checkout code will be changed.
Because of the 48kb limit on file uploads i had to split/zip up the package. :( Make a folder called includes and decompress the following in there: Classes.zip, languages.zip, modules.zip, templates.zip
Let me know how this works out for everyone. :smile:
4 Attachment(s)
Re: Order Delivery Date Support Thread
...continued from my last post
...apparently in addition to the 48kb limit you can only add 4 files at a time - what a pain in the ##########_. Talk about file limits from the 1990's.
Here are the four files to go inside the INCLUDES folder..
How can i change the avaliability day
I'm having a problem now with the desired delivery date. when customers want delivery next day in the calendar can't choose next day only thre days after and more but bot the next day or the next couple of days. How can i make it avaliable same day or days after "today" due to we work with flowers and we have option for same day delivery before 2pm weekdays and before 12pm on weekends. Could somebody help me out with this one because of the season i want to have it ready . Thank you in advance for your time and for your :(help.