Version Notes
-Allow shipping arrival date in admin panel also.
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | order_delivery_date |
| Version | 0.1.2 |
| Comparing to | |
| See all releases | |
Code changes from version 0.1.1 to 0.1.2
- app/code/local/Bc/Deliverydate/Helper/Data.php +12 -0
- app/code/local/Bc/Deliverydate/etc/config.xml +13 -1
- app/design/adminhtml/default/default/layout/deliverydate.xml +8 -0
- app/design/adminhtml/default/default/template/deliverydate/date.phtml +37 -0
- app/design/adminhtml/default/default/template/deliverydate/js/calendar.phtml +72 -0
- app/design/frontend/default/default/template/deliverydate/review/info.phtml +8 -1
- package.xml +12 -14
- skin/frontend/default/default/images/ico_reset.png +0 -0
app/code/local/Bc/Deliverydate/Helper/Data.php
CHANGED
|
@@ -44,6 +44,7 @@
|
|
| 44 |
return $formatedDate;
|
| 45 |
}
|
| 46 |
public function saveShippingArrivalDate($observer){
|
|
|
|
| 47 |
$order = $observer->getEvent()->getOrder();
|
| 48 |
if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==2){
|
| 49 |
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave(Mage::app()->getRequest()->getParam('shipping_arrival_date'));
|
|
@@ -57,4 +58,15 @@
|
|
| 57 |
$order->setShippingArrivalDate($desiredArrivalDate);
|
| 58 |
}
|
| 59 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
}
|
| 44 |
return $formatedDate;
|
| 45 |
}
|
| 46 |
public function saveShippingArrivalDate($observer){
|
| 47 |
+
|
| 48 |
$order = $observer->getEvent()->getOrder();
|
| 49 |
if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==2){
|
| 50 |
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave(Mage::app()->getRequest()->getParam('shipping_arrival_date'));
|
| 58 |
$order->setShippingArrivalDate($desiredArrivalDate);
|
| 59 |
}
|
| 60 |
}
|
| 61 |
+
public function saveShippingArrivalDateAdmin($observer){
|
| 62 |
+
|
| 63 |
+
$order = $observer->getEvent()->getOrder();
|
| 64 |
+
$cart = Mage::app()->getRequest()->getParams();
|
| 65 |
+
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($cart['shipping_arrival_date_display']);
|
| 66 |
+
$shipping_arrival_comments = $cart['shipping_arrival_comments'];
|
| 67 |
+
$order->setShippingArrivalComments($shipping_arrival_comments);
|
| 68 |
+
$order->setShippingArrivalDate($desiredArrivalDate);
|
| 69 |
+
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
}
|
app/code/local/Bc/Deliverydate/etc/config.xml
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
<config>
|
| 11 |
<modules>
|
| 12 |
<Bc_Deliverydate>
|
| 13 |
-
<version>0.1.
|
| 14 |
</Bc_Deliverydate>
|
| 15 |
</modules>
|
| 16 |
<frontend>
|
|
@@ -110,6 +110,18 @@
|
|
| 110 |
</deliverydate>
|
| 111 |
</updates>
|
| 112 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
</adminhtml>
|
| 114 |
<global>
|
| 115 |
<models>
|
| 10 |
<config>
|
| 11 |
<modules>
|
| 12 |
<Bc_Deliverydate>
|
| 13 |
+
<version>0.1.2</version>
|
| 14 |
</Bc_Deliverydate>
|
| 15 |
</modules>
|
| 16 |
<frontend>
|
| 110 |
</deliverydate>
|
| 111 |
</updates>
|
| 112 |
</layout>
|
| 113 |
+
<events>
|
| 114 |
+
<sales_order_save_before>
|
| 115 |
+
<observers>
|
| 116 |
+
<set_order_shippingarrivaldate>
|
| 117 |
+
<type>model</type>
|
| 118 |
+
<class>Bc_Deliverydate_Helper_Data</class>
|
| 119 |
+
<method>saveShippingArrivalDateAdmin</method>
|
| 120 |
+
</set_order_shippingarrivaldate>
|
| 121 |
+
</observers>
|
| 122 |
+
</sales_order_save_before>
|
| 123 |
+
|
| 124 |
+
</events>
|
| 125 |
</adminhtml>
|
| 126 |
<global>
|
| 127 |
<models>
|
app/design/adminhtml/default/default/layout/deliverydate.xml
CHANGED
|
@@ -4,6 +4,13 @@
|
|
| 4 |
<reference name="content">
|
| 5 |
<block type="deliverydate/adminhtml_deliverydate" name="deliverydate" />
|
| 6 |
</reference>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
</deliverydate_adminhtml_deliverydate_index>
|
| 8 |
<adminhtml_sales_order_view>
|
| 9 |
<reference name="order_tab_info">
|
|
@@ -12,4 +19,5 @@
|
|
| 12 |
</action>
|
| 13 |
</reference>
|
| 14 |
</adminhtml_sales_order_view>
|
|
|
|
| 15 |
</layout>
|
| 4 |
<reference name="content">
|
| 5 |
<block type="deliverydate/adminhtml_deliverydate" name="deliverydate" />
|
| 6 |
</reference>
|
| 7 |
+
<reference name="head">
|
| 8 |
+
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action>
|
| 9 |
+
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
|
| 10 |
+
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
|
| 11 |
+
<block type="core/html_calendar" name="head.calendar" as="calendar" template="deliverydate/js/calendar.phtml">
|
| 12 |
+
</block>
|
| 13 |
+
</reference>
|
| 14 |
</deliverydate_adminhtml_deliverydate_index>
|
| 15 |
<adminhtml_sales_order_view>
|
| 16 |
<reference name="order_tab_info">
|
| 19 |
</action>
|
| 20 |
</reference>
|
| 21 |
</adminhtml_sales_order_view>
|
| 22 |
+
|
| 23 |
</layout>
|
app/design/adminhtml/default/default/template/deliverydate/date.phtml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
if (Mage::getStoreConfig('deliverydate/deliverydate_general/enabled')==1){
|
| 3 |
+
if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==1){
|
| 4 |
+
?>
|
| 5 |
+
<div class="field">
|
| 6 |
+
|
| 7 |
+
<div class="input-box">
|
| 8 |
+
<label for="page_date-end"><?php echo Mage::helper('sales')->__('Delivery Date:') ?></label>
|
| 9 |
+
<input name="shipping_arrival_date_display" id="shipping_arrival_date_display" value="" type="text">
|
| 10 |
+
<img title="Select date" id="shipping_arrival_date_trig" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/images/grid-cal.gif'; ?>" class="v-middle"><a href="javascript:void(0)" id="link_reset" style="margin-left:5px;"><img src="<?php echo $this->getSkinUrl('images/ico_reset.png');?>" alt="" class="v-middle" title="Reset"></a>
|
| 11 |
+
</div>
|
| 12 |
+
|
| 13 |
+
<label for="shipping_arrival_comments">Delivery Comments:</label><br/>
|
| 14 |
+
<textarea cols="65" rows="8" name="shipping_arrival_comments" id="shipping_arrival_comments"></textarea>
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
</div>
|
| 18 |
+
<script type="text/javascript">
|
| 19 |
+
//<![CDATA[
|
| 20 |
+
Calendar.setup({
|
| 21 |
+
inputField : 'shipping_arrival_date_display',
|
| 22 |
+
ifFormat : '%Y-%m-%e %H:%M:%S',
|
| 23 |
+
button : 'shipping_arrival_date_trig',
|
| 24 |
+
showsTime : true,
|
| 25 |
+
align : 'Bl',
|
| 26 |
+
singleClick : true
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
Event.observe($('link_reset'),'click',function(){
|
| 30 |
+
$('shipping_arrival_date_display').setValue('');
|
| 31 |
+
});
|
| 32 |
+
//]]>
|
| 33 |
+
</script>
|
| 34 |
+
<?php
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
?>
|
app/design/adminhtml/default/default/template/deliverydate/js/calendar.phtml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
// no notice of license for now
|
| 3 |
+
?>
|
| 4 |
+
|
| 5 |
+
<?php
|
| 6 |
+
/**
|
| 7 |
+
* Calendar localization script. Should be put into page header.
|
| 8 |
+
*
|
| 9 |
+
* @see Mage_Core_Block_Html_Calendar
|
| 10 |
+
*/
|
| 11 |
+
?>
|
| 12 |
+
|
| 13 |
+
<script type="text/javascript">
|
| 14 |
+
//<![CDATA[
|
| 15 |
+
enUS = <?php echo $enUS?>; // en_US locale reference
|
| 16 |
+
Calendar._DN = <?php echo $days['wide']?>; // full day names
|
| 17 |
+
Calendar._SDN = <?php echo $days['abbreviated']?>; // short day names
|
| 18 |
+
Calendar._FD = <?php echo $firstDay?>; // First day of the week. "0" means display Sunday first, "1" means display Monday first, etc.
|
| 19 |
+
Calendar._MN = <?php echo $months['wide']?>; // full month names
|
| 20 |
+
Calendar._SMN = <?php echo $months['abbreviated']?>; // short month names
|
| 21 |
+
Calendar._am = <?php echo $am ?>; // am/pm
|
| 22 |
+
Calendar._pm = <?php echo $pm ?>;
|
| 23 |
+
|
| 24 |
+
// tooltips
|
| 25 |
+
Calendar._TT = {};
|
| 26 |
+
Calendar._TT["INFO"] = "<?php echo $this->__('About the calendar');?>";
|
| 27 |
+
|
| 28 |
+
Calendar._TT["ABOUT"] =
|
| 29 |
+
"<?php echo $this->__('DHTML Date/Time Selector')?>\n" +
|
| 30 |
+
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
|
| 31 |
+
"<?php echo $this->__('For latest version visit: %s', 'http://www.dynarch.com/projects/calendar/')?>\n" +
|
| 32 |
+
"<?php echo $this->__('Distributed under GNU LGPL. See %s for details.', 'http://gnu.org/licenses/lgpl.html')?>" +
|
| 33 |
+
"\n\n" +
|
| 34 |
+
"<?php echo $this->__('Date selection:')?>\n" +
|
| 35 |
+
"<?php echo $this->__('- Use the %s, %s buttons to select year', '\\xab', '\xbb')?>\n" +
|
| 36 |
+
"<?php echo $this->__('- Use the %s buttons to select month', '" + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "')?>\n" +
|
| 37 |
+
"<?php echo $this->__('- Hold mouse button on any of the above buttons for faster selection.')?>";
|
| 38 |
+
Calendar._TT["ABOUT_TIME"] = "\n\n" +
|
| 39 |
+
"<?php echo $this->__('Time selection:')?>\n" +
|
| 40 |
+
"<?php echo $this->__('- Click on any of the time parts to increase it')?>\n" +
|
| 41 |
+
"<?php echo $this->__('- or Shift-click to decrease it')?>\n" +
|
| 42 |
+
"<?php echo $this->__('- or click and drag for faster selection.')?>";
|
| 43 |
+
|
| 44 |
+
Calendar._TT["PREV_YEAR"] = "<?php echo $this->__('Prev. year (hold for menu)');?>";
|
| 45 |
+
Calendar._TT["PREV_MONTH"] = "<?php echo $this->__('Prev. month (hold for menu)');?>";
|
| 46 |
+
Calendar._TT["GO_TODAY"] = "<?php echo $this->__('Go Today');?>";
|
| 47 |
+
Calendar._TT["NEXT_MONTH"] = "<?php echo $this->__('Next month (hold for menu)');?>";
|
| 48 |
+
Calendar._TT["NEXT_YEAR"] = "<?php echo $this->__('Next year (hold for menu)');?>";
|
| 49 |
+
Calendar._TT["SEL_DATE"] = "<?php echo $this->__('Select date');?>";
|
| 50 |
+
Calendar._TT["DRAG_TO_MOVE"] = "<?php echo $this->__('Drag to move');?>";
|
| 51 |
+
Calendar._TT["PART_TODAY"] = ' (' + <?php echo $today ?> + ')';
|
| 52 |
+
|
| 53 |
+
// the following is to inform that "%s" is to be the first day of week
|
| 54 |
+
Calendar._TT["DAY_FIRST"] = "<?php echo $this->__('Display %s first', '%s');?>";
|
| 55 |
+
|
| 56 |
+
// This may be locale-dependent. It specifies the week-end days, as an array
|
| 57 |
+
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
|
| 58 |
+
// means Monday, etc.
|
| 59 |
+
Calendar._TT["WEEKEND"] = <?php echo $weekendDays?>;
|
| 60 |
+
|
| 61 |
+
Calendar._TT["CLOSE"] = "<?php echo $this->__('Close');?>";
|
| 62 |
+
Calendar._TT["TODAY"] = <?php echo $today ?>;
|
| 63 |
+
Calendar._TT["TIME_PART"] = "<?php echo $this->__('(Shift-)Click or drag to change value');?>";
|
| 64 |
+
|
| 65 |
+
// date formats
|
| 66 |
+
Calendar._TT["DEF_DATE_FORMAT"] = <?php echo $defaultFormat?>;
|
| 67 |
+
Calendar._TT["TT_DATE_FORMAT"] = <?php echo $toolTipFormat?>;
|
| 68 |
+
|
| 69 |
+
Calendar._TT["WK"] = <?php echo $week ?>;
|
| 70 |
+
Calendar._TT["TIME"] = "<?php echo $this->__('Time:');?>";
|
| 71 |
+
//]]>
|
| 72 |
+
</script>
|
app/design/frontend/default/default/template/deliverydate/review/info.phtml
CHANGED
|
@@ -69,14 +69,21 @@
|
|
| 69 |
</script>
|
| 70 |
<div id="checkout-review-submit">
|
| 71 |
<?php echo $this->getChildHtml('agreements') ?>
|
|
|
|
|
|
|
|
|
|
| 72 |
<div class="buttons-set" id="review-buttons-container">
|
|
|
|
| 73 |
<p class="f-left"><?php echo $this->__('Forgot an Item?') ?> <a href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Edit Your Cart') ?></a></p>
|
|
|
|
| 74 |
<?php echo $this->getChildHtml('button') ?>
|
| 75 |
<span class="please-wait" id="review-please-wait" style="display:none;">
|
| 76 |
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Submitting order information...') ?>" title="<?php echo $this->__('Submitting order information...') ?>" class="v-middle" /> <?php echo $this->__('Submitting order information...') ?>
|
| 77 |
</span>
|
| 78 |
</div>
|
| 79 |
-
|
|
|
|
|
|
|
| 80 |
<script type="text/javascript">
|
| 81 |
//<