-
HOW TO: Add a desired shipping date field to order form [description]
Desciption how to add a drop down list with desired delivery date to your order form [for Zen Cart 1.3.7]
Note: in the following description I use the table prefix zen_
If you have no prefix, or another then you'll have to change it yourself.
The file & directory names were taken from a local Win XP + XAMPP environment. At linux webhosting all "\" should be the other way "/" :smile:
Note2: I have to check the email confirmation.
The desired order date seems to be missing in the email confirmation.
1. Add field to zen_orders table
Code:
ALTER TABLE zen_orders ADD order_delivery_date date AFTER ip_address;
* FRONT-END *
2. tpl_checkout_shipping_default.php
File: includes\templates\classic\templates\tpl_checkout_shipping_default.php
In the checkout form I added a dropdown field with dates.
Note that I excluded some dates (1st & 2nd Christmas day and 1st January) because there won't be any deliveries.
Just before <fieldset class="shipping" id="comments"> I added:
Code:
<fieldset class="shipping" id="delivery_date">
<legend><?php echo TABLE_HEADING_DELIVERY_DATE; ?></legend>
<select name="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>
3. order.php
File: \includes\classes\order.php
I added the order_delivery_date field in some queries:
Code:
$order_query = "select customers_id, customers_name, customers_company,
customers_street_address, customers_suburb, customers_city,
customers_postcode, customers_state, customers_country,
customers_telephone, customers_email_address, customers_address_format_id,
delivery_name, delivery_company, delivery_street_address, delivery_suburb,
delivery_city, delivery_postcode, delivery_state, delivery_country,
delivery_address_format_id, billing_name, billing_company,
billing_street_address, billing_suburb, billing_city, billing_postcode,
billing_state, billing_country, billing_address_format_id,
payment_method, payment_module_code, shipping_method, shipping_module_code,
coupon_code, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value,
date_purchased, orders_status, last_modified, order_total, order_tax, ip_address
from " . TABLE_ORDERS . "
where orders_id = '" . (int)$order_id . "'";
the last 3 lines:
Code:
date_purchased, orders_status, last_modified, order_total, order_tax, ip_address, order_delivery_date
from " . TABLE_ORDERS . "
where orders_id = '" . (int)$order_id . "'";
and
Code:
$this->info = array('currency' => $order->fields['currency'],
'currency_value' => $order->fields['currency_value'],
'payment_method' => $order->fields['payment_method'],
'payment_module_code' => $order->fields['payment_module_code'],
'shipping_method' => $order->fields['shipping_method'],
'shipping_module_code' => $order->fields['shipping_module_code'],
'coupon_code' => $order->fields['coupon_code'],
'cc_type' => $order->fields['cc_type'],
'cc_owner' => $order->fields['cc_owner'],
'cc_number' => $order->fields['cc_number'],
'cc_expires' => $order->fields['cc_expires'],
'date_purchased' => $order->fields['date_purchased'],
'orders_status' => $order_status->fields['orders_status_name'],
'last_modified' => $order->fields['last_modified'],
'total' => $order->fields['order_total'],
'tax' => $order->fields['order_tax'],
'ip_address' => $order->fields['ip_address']
);
the last 3 lines:
Code:
'ip_address' => $order->fields['ip_address'],
'delivery_date' => $order->fields['delivery_date']
);
and
Code:
$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID,
'currency' => $_SESSION['currency'],
'currency_value' => $currencies->currencies[$_SESSION['currency']]['value'],
'payment_method' => $GLOBALS[$class]->title,
'payment_module_code' => $GLOBALS[$class]->code,
'coupon_code' => $coupon_code->fields['coupon_code'],
// 'cc_type' => (isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : ''),
// 'cc_owner' => (isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : ''),
// 'cc_number' => (isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : ''),
// 'cc_expires' => (isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : ''),
// 'cc_cvv' => (isset($GLOBALS['cc_cvv']) ? $GLOBALS['cc_cvv'] : ''),
'shipping_method' => $_SESSION['shipping']['title'],
'shipping_module_code' => $_SESSION['shipping']['id'],
'shipping_cost' => $_SESSION['shipping']['cost'],
'subtotal' => 0,
'tax' => 0,
'total' => 0,
'tax_groups' => array(),
'comments' => (isset($_SESSION['comments']) ? $_SESSION['comments'] : ''),
'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR']
);
the last 3 lines
Code:
'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'],
'delivery_date' => $_SESSION['delivery_date']
);
and
Code:
'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR']
);
zen_db_perform(TABLE_ORDERS, $sql_data_array);
changed into:
Code:
'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'],
'delivery_date' => $this->info['delivery_date']
);
zen_db_perform(TABLE_ORDERS, $sql_data_array);
4. header_php.php
File: \includes\modules\pages\checkout_shipping\header_php.php
I added some lines of code after:
Code:
if (isset($_SESSION['comments'])) {
$comments = $_SESSION['comments'];
}
I added:
Code:
if (isset($_SESSION['delivery_date'])) {
$delivery_date = $_SESSION['delivery_date'];
}
and after
Code:
$comments = $_SESSION['comments'];
I added:
Code:
if (zen_not_null($_POST['delivery_date'])) {
$_SESSION['delivery_date'] = zen_db_prepare_input($_POST['delivery_date']);
}
$delivery_date = $_SESSION['delivery_date'];
5. language file checkout_shipping.php
File: \includes\languages\english\checkout_shipping.php
For every language you'll have to insert:
Code:
define('TABLE_HEADING_DELIVERY_DATE', 'Desired Delivery Date');
* BACK-END *
6. order.php
File: \admin\includes\classes\order.php
I added to:
Code:
$order = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
customers_suburb, customers_city, customers_postcode, customers_id,
customers_state, customers_country, customers_telephone,
customers_email_address, customers_address_format_id, delivery_name,
delivery_company, delivery_street_address, delivery_suburb,
delivery_city, delivery_postcode, delivery_state, delivery_country,
delivery_address_format_id, billing_name, billing_company,
billing_street_address, billing_suburb, billing_city, billing_postcode,
billing_state, billing_country, billing_address_format_id,
coupon_code, payment_method, payment_module_code, shipping_method, shipping_module_code,
cc_type, cc_owner, cc_number, cc_expires, currency,
currency_value, date_purchased, orders_status, last_modified,
order_total, order_tax, ip_address
I added the order_delivery_date to the query:
Code:
order_total, order_tax, ip_address, order_delivery_date
and
Code:
$this->info = array('currency' => $order->fields['currency'],
'currency_value' => $order->fields['currency_value'],
'payment_method' => $order->fields['payment_method'],
'payment_module_code' => $order->fields['payment_module_code'],
'shipping_method' => $order->fields['shipping_method'],
'shipping_module_code' => $order->fields['shipping_module_code'],
'coupon_code' => $order->fields['coupon_code'],
'cc_type' => $order->fields['cc_type'],
'cc_owner' => $order->fields['cc_owner'],
'cc_number' => $order->fields['cc_number'],
'cc_cvv' => $order->fields['cc_cvv'],
'cc_expires' => $order->fields['cc_expires'],
'date_purchased' => $order->fields['date_purchased'],
'orders_status' => $order->fields['orders_status'],
'total' => $order->fields['order_total'],
'tax' => $order->fields['order_tax'],
'last_modified' => $order->fields['last_modified'],
'ip_address' => $order->fields['ip_address']
);
the last 3 lines:
Code:
'ip_address' => $order->fields['ip_address'],
'delivery_date' => $order->fields['order_delivery_date']
);
7. orders.php
File: \admin\orders.php
I changed:
Code:
EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
strip_tags($notify_comments) .
to:
Code:
EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']) . "\n\n" .
EMAIL_TEXT_DELIVERY_DATE . ' ' . zen_date_long($check_status->fields[' delivery_date']) . "\n\n" .
strip_tags($notify_comments) .
and
Code:
$html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
$html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
into:
Code:
$html_msg['EMAIL_TEXT_DATE_ORDERED'] = EMAIL_TEXT_DATE_ORDERED . ' ' . zen_date_long($check_status->fields['date_purchased']);
$html_msg['EMAIL_TEXT_DELIVERY_DATE'] = EMAIL_TEXT_DELIVERY_DATE . ' ' . zen_date_long($check_status->fields['delivery_date']);
$html_msg['EMAIL_TEXT_STATUS_COMMENTS'] = nl2br($notify_comments);
and
Code:
<tr>
<td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
</tr>
into
Code:
<tr>
<td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
</tr>
<tr>
<td class="main"><strong><?php echo ENTRY_DELIVERY_DATE; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['delivery_date']); ?></td>
</tr>
and
Code:
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
into:
Code:
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td>
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DELIVERY_DATE; ?></td>
<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
and
Code:
<td class="dataTableContent" align="center"><?php echo zen_datetime_short($orders->fields['date_purchased']); ?></td>
<td class="dataTableContent" align="right"><?php echo $orders->fields['orders_status_name']; ?></td>
into
Code:
<td class="dataTableContent" align="center"><?php echo zen_datetime_short($orders->fields['date_purchased']); ?></td>
<td class="dataTableContent" align="center"><?php echo zen_datetime_short($orders->fields['order_delivery_date']); ?></td>
<td class="dataTableContent" align="right"><?php echo $orders->fields['orders_status_name']; ?></td>
and
Code:
$orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified,
into:
Code:
$orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.order_delivery_date, o.last_modified,
and
Code:
$orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified,
into:
Code:
$orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.order_delivery_date, o.last_modified,
and
Code:
$orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.last_modified,
into:
Code:
$orders_query_raw = "select o.orders_id, o.customers_id, o.customers_name, o.payment_method, o.shipping_method, o.date_purchased, o.order_delivery_date, o.last_modified,
8. the invoice invoice.php
File: \admin\invoice.php
I changed
Code:
$order_check = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
customers_suburb, customers_city, customers_postcode,
customers_state, customers_country, customers_telephone,
customers_email_address, customers_address_format_id, delivery_name,
delivery_company, delivery_street_address, delivery_suburb,
delivery_city, delivery_postcode, delivery_state, delivery_country,
delivery_address_format_id, billing_name, billing_company,
billing_street_address, billing_suburb, billing_city, billing_postcode,
billing_state, billing_country, billing_address_format_id,
payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
currency_value, date_purchased, orders_status, last_modified
the last line into:
Code:
currency_value, date_purchased, orders_status, last_modified, order_delivery_date
and
Code:
<tr>
<td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
</tr>
into
Code:
<tr>
<td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
</tr>
<tr>
<td class="main"><strong><?php echo ENTRY_DELIVERY_DATE; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['delivery_date']); ?></td>
</tr>
9. packingslip: packingslip.php
File: \admin\packingslip.php
In:
Code:
$order_check = $db->Execute("select cc_cvv, customers_name, customers_company, customers_street_address,
customers_suburb, customers_city, customers_postcode,
customers_state, customers_country, customers_telephone,
customers_email_address, customers_address_format_id, delivery_name,
delivery_company, delivery_street_address, delivery_suburb,
delivery_city, delivery_postcode, delivery_state, delivery_country,
delivery_address_format_id, billing_name, billing_company,
billing_street_address, billing_suburb, billing_city, billing_postcode,
billing_state, billing_country, billing_address_format_id,
payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
currency_value, date_purchased, orders_status, last_modified
I changed the last line in:
Code:
currency_value, date_purchased, orders_status, last_modified, order_delivery_date
and changed
Code:
<tr>
<td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
</tr>
into:
Code:
<tr>
<td class="main"><strong><?php echo ENTRY_DATE_PURCHASED; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['date_purchased']); ?></td>
</tr>
<tr>
<td class="main"><strong><?php echo ENTRY_DELIVERY_DATE; ?></strong></td>
<td class="main"><?php echo zen_date_long($order->info['delivery_date']); ?></td>
</tr>
10. language file for orders
File: \includes\languages\english\orders.php
add:
Code:
define('TABLE_HEADING_DELIVERY_DATE', 'Desired Delivery Date');
define('ENTRY_DELIVERY_DATE', 'Desired Delivery Date:');
11. language file for invoice
File: \includes\languages\english\invoice.php
add:
Code:
define('ENTRY_DELIVERY_DATE', 'Desired Delivery Date:');
12. language file for packingslip
File: \includes\languages\english\packingslip.php
add:
Code:
define('ENTRY_DELIVERY_DATE', 'Desired Delivery Date:');
I hope that other people can use this description of the modification that I made. If you have any comments / additions / corrections: please post in this thread....
-
Re: HOW TO: Add a desired shipping date field to order form [description]
I am trying to send the desired delivery date in the email messages, but it's still not working.
Here follows a description for the changes I made so far.
*** First of all I have change all references in the description above from delivery_date to order_delivery_date ! ***
13. email order status
File \email\email_template_order_status.html
changed:
Code:
<div>$EMAIL_TEXT_DATE_ORDERED</div>
<div>$EMAIL_TEXT_STATUS_COMMENTS</div>
into:
Quote:
<div>$EMAIL_TEXT_DATE_ORDERED</div>
<div>$EMAIL_TEXT_DELIVERY_DATE</div>
<div>$EMAIL_TEXT_STATUS_COMMENTS</div>
14. order class
File: \includes\classes\order.php
Code:
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
into:
Code:
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
EMAIL_TEXT_DELIVERY_DATE . ' ' . zen_date_long($check_status->fields['order_delivery_date']) . "\n\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
15. language file checkout_process.php
File: \includes\languages\english\checkout_process.php
add
Code:
define('EMAIL_TEXT_DELIVERY_DATE', 'Desired Delivery Date:');
16. language file orders.php
File: \includes\languages\english\orders.php
add
Code:
define('EMAIL_TEXT_DELIVERY_DATE', 'Desired Delivery Date:');
17. order.php
File: includes\classes\order.php
Code:
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
changed into:
Code:
EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n" .
EMAIL_TEXT_DELIVERY_DATE . ' ' . zen_db_output($this->info['order_delivery_date']) . "\n\n" .
EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";
Code:
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => $this->info['order_status'],
'date_added' => 'now()',
'customer_notified' => $customer_notification,
'comments' => $this->info['comments']);
changed into:
Code:
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => $this->info['order_status'],
'date_added' => 'now()',
'order_delivery_date' => $this->info['order_delivery_date']);
'customer_notified' => $customer_notification,
'comments' => $this->info['comments']);
18. orders.php in admin back-end
File: \admin\orders.php
Code:
$check_status = $db->Execute("select customers_name, customers_email_address, orders_status,
date_purchased, order_delivery_date from " . TABLE_ORDERS . "
where orders_id = '" . $_GET['oID'] . "'");
into:
Code:
$check_status = $db->Execute("select customers_name, customers_email_address, orders_status,
date_purchased, order_delivery_date from " . TABLE_ORDERS . "
where orders_id = '" . $_GET['oID'] . "'");
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Ok, I had to make a couple of additional changes in order to get the confirmation email with date working correctly!
Sorry for the confusion!
BTW: The email sent from the back-end (in admin/orders.php e.g. after change of status) does not contain the date.
Instead there's an empty space....
Hopefully does someone else know a solution...
19. orders in back-end
File: \admin\orders.php
Code:
// adjust download_maxdays based on current date
$check_status = $db->Execute("select customers_name, customers_email_address, orders_status,
date_purchased, order_delivery_date from " . TABLE_ORDERS . "
where orders_id = '" . $_GET['oID'] . "'");
changed into:
Code:
// adjust download_maxdays based on current date
$check_status = $db->Execute("select customers_name, customers_email_address, orders_status,
date_purchased from " . TABLE_ORDERS . "
where orders_id = '" . $_GET['oID'] . "'");
20. the front-end order class
File: includes\classes\order.php
Code:
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => $this->info['order_status'],
'date_added' => 'now()',
'order_delivery_date' => $this->info['order_delivery_date'],
'customer_notified' => $customer_notification,
'comments' => $this->info['comments']);
changed into
Code:
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => $this->info['order_status'],
'date_added' => 'now()',
'customer_notified' => $customer_notification,
'comments' => $this->info['comments']);
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Thanks for posting this. I know alot of zenners have been waiting for someone to work this one out! I have a few questions.
- In #10 the file mentioned \includes\languages\english\orders.php - I don't have that file, but I do have that file in the admin directory (admin\\includes\languages\english\orders.php). Is that the one you mean?
- How would I remove Saturday as a shipping date?
- Would it be possible to add a Cancel date as well? Most wholesale companies have that.
- Will you be also adding the field to Account history order page that a customer sees when they are logged in and looking at their orders?
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
dreamz
In #10 the file mentioned \includes\languages\english\orders.php - I don't have that file, but I do have that file in the admin directory (admin\\includes\languages\english\orders.php). Is that the one you mean?
Yes, I do indeed mean the language file in \admin\
thank you for your correction!
Quote:
How would I remove Saturday as a shipping date?
You'll have to change the part strftime ("%A %d %B %Y",$now[$i])
in the file tpl_checkout_shipping_default.php (See step 2. Front-end )
Remove the "%A" because it displays the "full weekday name according to the current locale" (see the php.net documentation for strftime at http://php.net/manual/en/function.strftime.php )
Quote:
Would it be possible to add a Cancel date as well? Most wholesale companies have that.
Probably. I don't know this functionality. Maybe you could elaborate on this: how should a cancel date be implemented in the order process, and how does it work?
Quote:
Will you be also adding the field to Account history order page that a customer sees when they are logged in and looking at their orders?
I haven't found the time for that yet.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
A cancel date is usually coupled with a ship date in wholesale orders. That is - it is a window of time where the purchase can be shipped within. I guess it would just be a second field very much like order_delivery_date, but it would be order_cancel_date.
The only difference I see between the two fields would be that order_cancel_date could not take place before order_delivery_date. One other option in the drop down for order_cancel_date and should default to is empty which would indicate no cancel date. That would make sense for orders that are not wholesale and/or do not require a cancel ship date.
Thanks, again!
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Hi guys,
Have you managed the confirmation email issue regarding this feature??
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Does anyone have a site that this mod is working on so I can see how it works?
-
Re: HOW TO: Add a desired shipping date field to order form [description]
I've tried this on 3.7.8 but it doesn't work.
Anyone tried this before?
Thanks
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Based on this post and some others, I've posted net terms, start order date and start and cancel order date modules. You can find out more at Zen Cart Purchase Order System
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Please add your modules to the Downloads Section.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
Bey12
Based on this post and some others, I've posted net terms, start order date and start and cancel order date modules.
I concur with Kim - this is a fantastic (and simple) mod and will have a warm welcome to the downloads section.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
It's now in the Downloads section over here
Included in the zip file are two folders with separate modules - one is for adding only the Ship Order Date and the other is to add both Ship Order and Cancel Order Date.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Great! I haven't had time yet to compile this into a distributable contribution.
Thanks for this contribution, James!
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
pe7er
Great! I haven't had time yet to compile this into a distributable contribution.
Thanks for this contribution, James!
Hey Everyone -
I have applied this mod to a site and found that it still needs a bit of work - but it has an Excellent start!
So, first thing that i'd like to tackle is the fact that the emails are not including the delivery date.
I'm hopeing that someone would be able to explain how and where the email arrays are formed. Anyone?
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
mrmeech
Hey Everyone -
I have applied this mod to a site and found that it still needs a bit of work - but it has an Excellent start!
So, first thing that i'd like to tackle is the fact that the emails are not including the delivery date.
I'm hopeing that someone would be able to explain how and where the email arrays are formed. Anyone?
I should clarify this post, as my problem is not very clear:
When order related emails are sent, the place where the delivery date information is supposed to be simply prints out on the email as: EMAIL_TEXT_DELIVERY_DATE
I am pretty sure the problem resides in the orders.php file either on the admin side or on the catalog side, but i cannot figure out why. I am not yet familiar with the email data-flow.
On the contrary, the order date information appears correctly on the order information (invoice, packing slip, edit order) pages when logged into the admin.
Any help or pointers would be greatly appreciated. :smile:
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Well, i'm not sure if anyone is listening out there - but i just did a lot of work on this mod over the past two days and now have an updated version 100% ready to be uploaded. HOWEVER, i am waiting to upload it to the community - i wrote an email to Ajeh and Kim explain why i am not uploading it yet, and i will append that email to the end of this post for everyone to read and give their input. I do not want any hard feelings.
I've notated this all in the readme.txt file, but so that everyone knows what is ready to go:
Quote:
HISTORY:
03/24/2008:
Updated to fix a number of issues in code and add a couple other features (By MrMeech):
- Added File (includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_confirmation_default.php) - Added Delivery Date to display on checkout confirmation page
- Added File (includes/languages/english/YOUR_TEMPLATE/checkout_confirmation) - has Delivery Date define
- Added File (email/email_template_checkout.html) - to show delivery date on email generated during checkout, in addition to when orders are updated via Admin
- (admin/includes/classes/order.php) - Fixed "info" array "delivery_date" to "order_delivery_date" to match format of the rest of the array and unify all code references to the array. Also some code would reference "delivery_date" and some would reference "order_delivery_date", so everything is now "order_delivery_date".
- (admin/includes/languages/english/orders.php) - Added missing email define
- (admin/invoice.php) - Line 150 - changed to "order_delivery_date"
- (admin/orders.php) - Removed extra space in string and updated to correct path (line 108); Updated line 117 to "order_delivery_date" from "delivery_date"; Updated line 414 to reflect similar changes
- (admin/packingslip.php) - Line 147 updated to "order_delivery_date"
- (includes/classes/order.php) - Line 924 - Was missing the HTML variable for HTML email output
- Added contribution info to the comments at the top of every file (except the emails) for easier version tracking down the road.
- Updated this file (readme.txt)
03/13/2008:
First compiled release of this modification
02/13/2008:
Peter Martin's Post to the forum of the initial code
Ok, now, for the email to Ajeh and Kim:
Quote:
Kim (and now Linda, too!),
You haven't responded yet, but that's a good thing in this situation as i figured out how to update existing contributions.
However, i come to you now with a situation a little out of the norm - please read this message all the way through.
Based on this thread:
http://www.zen-cart.com/forum/showthread.php?t=88550
...this contribution was born:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_ id=961
Unfortunately this contribution seems to have been slapped together in hyperspeed and i really feel as if it should be split in two. Right now it contains both the "Ship Order Date" and "Cancel Order Date." Confusingly, the "Cancel Order Date" folder is supposed to include the ship order date folder mod... Aside from that, this mod is designed to add a DELIVERY date, not a SHIP date.
Additionally, If you compare on the two top-level directories ("ship-cancel date" and "ship date") you will find that, aside from the SQL query, they are identical (unless i'm crazy and missed something). My file compare program (Kdiff3) noted that the one template override file for the checkout differed, but upon viewing them, they were carbon copies of one another.
I have spent a number of hours looking at the code for this, and while it is 90% complete, it has a fatal last 10%, with errors that will translate all the way to email outputs. There are a handful of other mishaps in the code, but the purpose of this message is not to review all of them...
I have updated the code to work on my site, and now that i know where all of the errors are, it will take me only a few minutes to go back through the current contribution code to fix it for the community. I can have this ready to go in a day (since i'm pooped now and am calling it quits for the night).
So, this is what i propose:
- Renaming this contribution to "Order Delivery Date" - or delete/freeze this contribution to avoid the confusion that is likely going to ensue.
- Depending on the action that you take: If you rename the contribution, i will upload the fixed code directly to the contribution, or; If you delete/freeze the contribution, i will make a new one.
- I also really believe that a new support thread with a more relevant title (ie: "Order Delivery Date" instead of "Ship Date") should be formed - i will be glad to do this - just looking for backup on it.
Please inform me of your thoughts on all of this and what plan of action you believe is best.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
I was able to send email with delivery date as well in the admin as well.
In the orders.PHP, we have written
EMAIL_TEXT_DELIVERY_DATE . ' ' . zen_date_long($check_status->fields[' delivery_date']) . "\n\n"
but we did not add this field to the $checkstatus=$db->Execute
and one more thing, we did not define EMAIL_TEXT_DELIVERY_DATE under /admin/languages
It worked for me, if any qiestions I can be contacted kishore_veeramallu###################### or 630-235-9772
Thank you pe7er for lot of coding there...
-
Re: HOW TO: Add a desired shipping date field to order form [description]
has anyone tested this with super orders?
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Hello All,
I tried to install this template and copied all files into the directories and it looks like it was working for showing the Desired Delivery Date on the shipping page but i see nothing about cancel date anywhere.
Is there something I am missing or is it not working? Has anyone else had a problem with this? I am using Zencart 1.3.8.
Thanks for the help.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
velvetangels
Hello All,
I tried to install this template and copied all files into the directories and it looks like it was working for showing the Desired Delivery Date on the shipping page but i see nothing about cancel date anywhere.
Is there something I am missing or is it not working? Has anyone else had a problem with this? I am using Zencart 1.3.8.
Thanks for the help.
Velvetangels,
I'm confused as to whether or nt you're interested in the Cancel Date part of this code... if not, check out the "Order Delivery Date" mod in the downloads section.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
mrmeech
Velvetangels,
I'm confused as to whether or nt you're interested in the Cancel Date part of this code... if not, check out the "Order Delivery Date" mod in the downloads section.
Mrmeech,
Actually I am very interested in both a cancel date and a desired delivery date but when I tried to install the option that had both cancel and delivery dates only the delivery date would show up. I tried searching through the script for anything that contained order_cancel_date (the sql field for the cancel date) and I found nothing.
We are a wholesaler and both are very helpful for our customers.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
velvetangels
Mrmeech,
Actually I am very interested in both a cancel date and a desired delivery date but when I tried to install the option that had both cancel and delivery dates only the delivery date would show up. I tried searching through the script for anything that contained order_cancel_date (the sql field for the cancel date) and I found nothing.
We are a wholesaler and both are very helpful for our customers.
Hmmm... Well, the Order Delivery Date mod is (more or less) a re-working of the mod that you are interested in, only when revised the code i only did the Delivery Date part and not the cancel date. Reasons being (but not limited to): Poorly packaged, there were a LOT of errors in the code, the cancel date didn't work to begin with (just like you're experiencing), and i didn't need it.
If you are a decent coder, it shouldn't be too hard to look through the code for the Order Delivery Date mod that i have and add in a cancel date feature along side. Or is that a bit much for your current skill level?
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
mrmeech
Hmmm... Well, the Order Delivery Date mod is (more or less) a re-working of the mod that you are interested in, only when revised the code i only did the Delivery Date part and not the cancel date. Reasons being (but not limited to): Poorly packaged, there were a LOT of errors in the code, the cancel date didn't work to begin with (just like you're experiencing), and i didn't need it.
If you are a decent coder, it shouldn't be too hard to look through the code for the Order Delivery Date mod that i have and add in a cancel date feature along side. Or is that a bit much for your current skill level?
MrMeech,
I think I am an ok PHP coder (only been doing it for about a year and self taught). I think this is defiantly out of my scope to do but I will work towards seeing if I can make it work.
Thanks for the advice.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
velvetangels
MrMeech,
I think I am an ok PHP coder (only been doing it for about a year and self taught). I think this is defiantly out of my scope to do but I will work towards seeing if I can make it work.
Thanks for the advice.
Off the top of my head can tell you that you're going to want to:
- pay close attention to includes/classes/order.php. Look where the modifications for the order delivery date mod is... usually they are called "order_delivery_date" (go figure)
- Update your language defines in english/YOUR_TEMPLATE/*.php
- Update includes/templates/YOUR_TEMPLATE/templates/checkout_*.php to display your cancel date info or whatever
- Update admin/orders.php so that when you generate an email from an order page it will include the cancel date, as well as display the cancel date info on the orders page.
- Make sure you update admin/includes/classes/order.php as well
best of luck and let me know how you make out!!
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Hi,
Just read through this tread and I'm very interested, but instead of date would it be possible to edit mod to use time instead, I'm setting up a catering site where customers can order and collect or have delivered , but some items are call order and need to be cooked so a collection/delivery time would be really useful?
Cheers
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
madge33
Hi,
Just read through this tread and I'm very interested, but instead of date would it be possible to edit mod to use time instead, I'm setting up a catering site where customers can order and collect or have delivered , but some items are call order and need to be cooked so a collection/delivery time would be really useful?
Cheers
This question, more or less, just came up in the actual delivery date mod thread. Take a look at posts 61 and my response (post 62) here: http://www.zen-cart.com/forum/showth...t=92762&page=7
It's pretty much the same exact principle.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Cheers for that I'll stay posted.
-
Re: HOW TO: Add a desired shipping date field to order form [description]
Quote:
Originally Posted by
madge33
Cheers for that I'll stay posted.
Yeah, subscribe to the Order Delivery Date Support Thread and keep an eyeball on it. :smile: