Version Notes
-solve third party payment option issue
Download this release
Release Info
| Developer | Biztech |
| Extension | order_delivery_date |
| Version | 0.1.5 |
| Comparing to | |
| See all releases | |
Code changes from version 0.1.4 to 0.1.5
- app/code/local/Bc/Deliverydate/Helper/Data.php +13 -7
- app/code/local/Bc/Deliverydate/Model/Observer.php +29 -27
- app/code/local/Bc/Deliverydate/etc/config.xml +188 -188
- app/design/frontend/default/default/layout/deliverydate.xml +16 -0
- app/design/frontend/default/default/template/deliverydate/agreements.phtml +6 -4
- app/design/frontend/default/default/template/deliverydate/deliverydate.phtml +231 -230
- app/design/frontend/default/default/template/deliverydate/review/info.phtml +2 -9
- app/etc/modules/Bc_Deliverydate.xml +8 -8
- package.xml +28 -10
- skin/frontend/{base → default}/default/images/ico_reset.png +0 -0
app/code/local/Bc/Deliverydate/Helper/Data.php
CHANGED
|
@@ -48,24 +48,30 @@
|
|
| 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'));
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
}else{
|
| 54 |
$cart = Mage::getModel('checkout/cart')->getQuote()->getData();
|
| 55 |
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($cart['shipping_arrival_date']);
|
| 56 |
$shipping_arrival_comments = $cart['shipping_arrival_comments'];
|
| 57 |
-
$
|
| 58 |
-
|
|
|
|
|
|
|
| 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 |
-
$
|
| 68 |
-
|
|
|
|
|
|
|
| 69 |
|
| 70 |
}
|
| 71 |
|
| 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'));
|
| 51 |
+
if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
|
| 52 |
+
$order->setShippingArrivalComments(Mage::app()->getRequest()->getParam('shipping_arrival_comments'));
|
| 53 |
+
$order->setShippingArrivalDate($desiredArrivalDate);
|
| 54 |
+
}
|
| 55 |
}else{
|
| 56 |
$cart = Mage::getModel('checkout/cart')->getQuote()->getData();
|
| 57 |
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($cart['shipping_arrival_date']);
|
| 58 |
$shipping_arrival_comments = $cart['shipping_arrival_comments'];
|
| 59 |
+
if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
|
| 60 |
+
$order->setShippingArrivalComments($shipping_arrival_comments);
|
| 61 |
+
$order->setShippingArrivalDate($desiredArrivalDate);
|
| 62 |
+
}
|
| 63 |
}
|
| 64 |
}
|
| 65 |
public function saveShippingArrivalDateAdmin($observer){
|
| 66 |
+
|
| 67 |
$order = $observer->getEvent()->getOrder();
|
| 68 |
$cart = Mage::app()->getRequest()->getParams();
|
| 69 |
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($cart['shipping_arrival_date_display']);
|
| 70 |
$shipping_arrival_comments = $cart['shipping_arrival_comments'];
|
| 71 |
+
if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
|
| 72 |
+
$order->setShippingArrivalComments($shipping_arrival_comments);
|
| 73 |
+
$order->setShippingArrivalDate($desiredArrivalDate);
|
| 74 |
+
}
|
| 75 |
|
| 76 |
}
|
| 77 |
|
app/code/local/Bc/Deliverydate/Model/Observer.php
CHANGED
|
@@ -1,28 +1,30 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
/**
|
| 3 |
-
* CustomSearch Observer
|
| 4 |
-
*
|
| 5 |
-
* @category Exxex
|
| 6 |
-
* @package Essex_Customermod
|
| 7 |
-
* @author Sharpdotinc.com
|
| 8 |
-
*/
|
| 9 |
-
class Bc_Deliverydate_Model_Observer
|
| 10 |
-
{
|
| 11 |
-
|
| 12 |
-
public function checkout_controller_onepage_save_shipping_method($observer)
|
| 13 |
-
{
|
| 14 |
-
if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==1){
|
| 15 |
-
$request = $observer->getEvent()->getRequest();
|
| 16 |
-
$quote = $observer->getEvent()->getQuote();
|
| 17 |
-
|
| 18 |
-
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($request->getPost('shipping_arrival_date', ''));
|
| 19 |
-
$
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
}
|
| 1 |
+
<?php
|
| 2 |
+
/**
|
| 3 |
+
* CustomSearch Observer
|
| 4 |
+
*
|
| 5 |
+
* @category Exxex
|
| 6 |
+
* @package Essex_Customermod
|
| 7 |
+
* @author Sharpdotinc.com
|
| 8 |
+
*/
|
| 9 |
+
class Bc_Deliverydate_Model_Observer
|
| 10 |
+
{
|
| 11 |
+
|
| 12 |
+
public function checkout_controller_onepage_save_shipping_method($observer)
|
| 13 |
+
{
|
| 14 |
+
if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==1){
|
| 15 |
+
$request = $observer->getEvent()->getRequest();
|
| 16 |
+
$quote = $observer->getEvent()->getQuote();
|
| 17 |
+
|
| 18 |
+
$desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($request->getPost('shipping_arrival_date', ''));
|
| 19 |
+
if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
|
| 20 |
+
$quote->setShippingArrivalDate($desiredArrivalDate);
|
| 21 |
+
$quote->setShippingArrivalComments($request->getPost('shipping_arrival_comments'));
|
| 22 |
+
$quote->save();
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
return $this;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
}
|
app/code/local/Bc/Deliverydate/etc/config.xml
CHANGED
|
@@ -1,189 +1,189 @@
|
|
| 1 |
-
<?xml version="1.0"?>
|
| 2 |
-
<!--
|
| 3 |
-
/**
|
| 4 |
-
* @category Bc
|
| 5 |
-
* @package Bc_Deliverydate
|
| 6 |
-
* @author ModuleCreator
|
| 7 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 8 |
-
*/
|
| 9 |
-
-->
|
| 10 |
-
<config>
|
| 11 |
-
<modules>
|
| 12 |
-
<Bc_Deliverydate>
|
| 13 |
-
<version>0.1.
|
| 14 |
-
</Bc_Deliverydate>
|
| 15 |
-
</modules>
|
| 16 |
-
<frontend>
|
| 17 |
-
<routers>
|
| 18 |
-
<deliverydate>
|
| 19 |
-
<use>standard</use>
|
| 20 |
-
<args>
|
| 21 |
-
<module>Bc_Deliverydate</module>
|
| 22 |
-
<frontName>deliverydate</frontName>
|
| 23 |
-
</args>
|
| 24 |
-
</deliverydate>
|
| 25 |
-
</routers>
|
| 26 |
-
<layout>
|
| 27 |
-
<updates>
|
| 28 |
-
<deliverydate>
|
| 29 |
-
<file>deliverydate.xml</file>
|
| 30 |
-
</deliverydate>
|
| 31 |
-
</updates>
|
| 32 |
-
</layout>
|
| 33 |
-
|
| 34 |
-
<events>
|
| 35 |
-
<checkout_controller_onepage_save_shipping_method>
|
| 36 |
-
<observers>
|
| 37 |
-
<deliverydate_observer>
|
| 38 |
-
<type>singleton</type>
|
| 39 |
-
<class>deliverydate/observer</class>
|
| 40 |
-
<method>checkout_controller_onepage_save_shipping_method</method>
|
| 41 |
-
</deliverydate_observer>
|
| 42 |
-
</observers>
|
| 43 |
-
</checkout_controller_onepage_save_shipping_method>
|
| 44 |
-
<
|
| 45 |
-
<observers>
|
| 46 |
-
<order_set_shippingarrivaldate>
|
| 47 |
-
<type>model</type>
|
| 48 |
-
<class>Bc_Deliverydate_Helper_Data</class>
|
| 49 |
-
<method>saveShippingArrivalDate</method>
|
| 50 |
-
</order_set_shippingarrivaldate>
|
| 51 |
-
</observers>
|
| 52 |
-
</
|
| 53 |
-
</events>
|
| 54 |
-
</frontend>
|
| 55 |
-
<admin>
|
| 56 |
-
<routers>
|
| 57 |
-
<deliverydate>
|
| 58 |
-
<use>admin</use>
|
| 59 |
-
<args>
|
| 60 |
-
<module>Bc_Deliverydate</module>
|
| 61 |
-
<frontName>deliverydate</frontName>
|
| 62 |
-
</args>
|
| 63 |
-
</deliverydate>
|
| 64 |
-
</routers>
|
| 65 |
-
</admin>
|
| 66 |
-
<adminhtml>
|
| 67 |
-
<!--<menu>
|
| 68 |
-
<deliverydate module="deliverydate">
|
| 69 |
-
<title>Deliverydate</title>
|
| 70 |
-
<sort_order>71</sort_order>
|
| 71 |
-
<children>
|
| 72 |
-
<items module="deliverydate">
|
| 73 |
-
<title>Manage Items</title>
|
| 74 |
-
<sort_order>0</sort_order>
|
| 75 |
-
<action>deliverydate/adminhtml_deliverydate</action>
|
| 76 |
-
</items>
|
| 77 |
-
</children>
|
| 78 |
-
</deliverydate>
|
| 79 |
-
</menu>-->
|
| 80 |
-
<acl>
|
| 81 |
-
<resources>
|
| 82 |
-
<all>
|
| 83 |
-
<title>Allow Everything</title>
|
| 84 |
-
</all>
|
| 85 |
-
<admin>
|
| 86 |
-
<children>
|
| 87 |
-
<Bc_Deliverydate>
|
| 88 |
-
<title>Deliverydate Module</title>
|
| 89 |
-
<sort_order>10</sort_order>
|
| 90 |
-
</Bc_Deliverydate>
|
| 91 |
-
<system>
|
| 92 |
-
<children>
|
| 93 |
-
<config>
|
| 94 |
-
<children>
|
| 95 |
-
<deliverydate>
|
| 96 |
-
<title>Delivery Date</title>
|
| 97 |
-
</deliverydate>
|
| 98 |
-
</children>
|
| 99 |
-
</config>
|
| 100 |
-
</children>
|
| 101 |
-
</system>
|
| 102 |
-
</children>
|
| 103 |
-
</admin>
|
| 104 |
-
</resources>
|
| 105 |
-
</acl>
|
| 106 |
-
<layout>
|
| 107 |
-
<updates>
|
| 108 |
-
<deliverydate>
|
| 109 |
-
<file>deliverydate.xml</file>
|
| 110 |
-
</deliverydate>
|
| 111 |
-
</updates>
|
| 112 |
-
</layout>
|
| 113 |
-
<events>
|
| 114 |
-
<
|
| 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 |
-
</
|
| 123 |
-
|
| 124 |
-
</events>
|
| 125 |
-
</adminhtml>
|
| 126 |
-
<global>
|
| 127 |
-
<models>
|
| 128 |
-
<deliverydate>
|
| 129 |
-
<class>Bc_Deliverydate_Model</class>
|
| 130 |
-
<resourceModel>deliverydate_mysql4</resourceModel>
|
| 131 |
-
</deliverydate>
|
| 132 |
-
<deliverydate_mysql4>
|
| 133 |
-
<class>Bc_Deliverydate_Model_Mysql4</class>
|
| 134 |
-
<entities>
|
| 135 |
-
<deliverydate>
|
| 136 |
-
<table>deliverydate</table>
|
| 137 |
-
</deliverydate>
|
| 138 |
-
</entities>
|
| 139 |
-
</deliverydate_mysql4>
|
| 140 |
-
</models>
|
| 141 |
-
<resources>
|
| 142 |
-
<deliverydate_setup>
|
| 143 |
-
<setup>
|
| 144 |
-
<module>Bc_Deliverydate</module>
|
| 145 |
-
</setup>
|
| 146 |
-
<connection>
|
| 147 |
-
<use>core_setup</use>
|
| 148 |
-
</connection>
|
| 149 |
-
</deliverydate_setup>
|
| 150 |
-
<deliverydate_write>
|
| 151 |
-
<connection>
|
| 152 |
-
<use>core_write</use>
|
| 153 |
-
</connection>
|
| 154 |
-
</deliverydate_write>
|
| 155 |
-
<deliverydate_read>
|
| 156 |
-
<connection>
|
| 157 |
-
<use>core_read</use>
|
| 158 |
-
</connection>
|
| 159 |
-
</deliverydate_read>
|
| 160 |
-
</resources>
|
| 161 |
-
<blocks>
|
| 162 |
-
<deliverydate>
|
| 163 |
-
<class>Bc_Deliverydate_Block</class>
|
| 164 |
-
</deliverydate>
|
| 165 |
-
<sales>
|
| 166 |
-
<rewrite>
|
| 167 |
-
<order_info>Bc_Deliverydate_Block_Order_Info</order_info>
|
| 168 |
-
</rewrite>
|
| 169 |
-
</sales>
|
| 170 |
-
</blocks>
|
| 171 |
-
<helpers>
|
| 172 |
-
<deliverydate>
|
| 173 |
-
<class>Bc_Deliverydate_Helper</class>
|
| 174 |
-
</deliverydate>
|
| 175 |
-
</helpers>
|
| 176 |
-
<default>
|
| 177 |
-
<deliverydate>
|
| 178 |
-
<deliverydate_general>
|
| 179 |
-
<enabled>0</enabled>
|
| 180 |
-
<on_which_page>1</on_which_page>
|
| 181 |
-
<deliverydate_html>Please choose your preferrable future delivery time for current #order.</deliverydate_html>
|
| 182 |
-
<deliverydate_format>d/M/Y</deliverydate_format>
|
| 183 |
-
<deliverytime_format>g:i a</deliverytime_format>
|
| 184 |
-
<deliverydate_dayoff></deliverydate_dayoff>
|
| 185 |
-
</deliverydate_general>
|
| 186 |
-
</deliverydate>
|
| 187 |
-
</default>
|
| 188 |
-
</global>
|
| 189 |
</config>
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!--
|
| 3 |
+
/**
|
| 4 |
+
* @category Bc
|
| 5 |
+
* @package Bc_Deliverydate
|
| 6 |
+
* @author ModuleCreator
|
| 7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 8 |
+
*/
|
| 9 |
+
-->
|
| 10 |
+
<config>
|
| 11 |
+
<modules>
|
| 12 |
+
<Bc_Deliverydate>
|
| 13 |
+
<version>0.1.5</version>
|
| 14 |
+
</Bc_Deliverydate>
|
| 15 |
+
</modules>
|
| 16 |
+
<frontend>
|
| 17 |
+
<routers>
|
| 18 |
+
<deliverydate>
|
| 19 |
+
<use>standard</use>
|
| 20 |
+
<args>
|
| 21 |
+
<module>Bc_Deliverydate</module>
|
| 22 |
+
<frontName>deliverydate</frontName>
|
| 23 |
+
</args>
|
| 24 |
+
</deliverydate>
|
| 25 |
+
</routers>
|
| 26 |
+
<layout>
|
| 27 |
+
<updates>
|
| 28 |
+
<deliverydate>
|
| 29 |
+
<file>deliverydate.xml</file>
|
| 30 |
+
</deliverydate>
|
| 31 |
+
</updates>
|
| 32 |
+
</layout>
|
| 33 |
+
|
| 34 |
+
<events>
|
| 35 |
+
<checkout_controller_onepage_save_shipping_method>
|
| 36 |
+
<observers>
|
| 37 |
+
<deliverydate_observer>
|
| 38 |
+
<type>singleton</type>
|
| 39 |
+
<class>deliverydate/observer</class>
|
| 40 |
+
<method>checkout_controller_onepage_save_shipping_method</method>
|
| 41 |
+
</deliverydate_observer>
|
| 42 |
+
</observers>
|
| 43 |
+
</checkout_controller_onepage_save_shipping_method>
|
| 44 |
+
<sales_order_save_after>
|
| 45 |
+
<observers>
|
| 46 |
+
<order_set_shippingarrivaldate>
|
| 47 |
+
<type>model</type>
|
| 48 |
+
<class>Bc_Deliverydate_Helper_Data</class>
|
| 49 |
+
<method>saveShippingArrivalDate</method>
|
| 50 |
+
</order_set_shippingarrivaldate>
|
| 51 |
+
</observers>
|
| 52 |
+
</sales_order_save_after>
|
| 53 |
+
</events>
|
| 54 |
+
</frontend>
|
| 55 |
+
<admin>
|
| 56 |
+
<routers>
|
| 57 |
+
<deliverydate>
|
| 58 |
+
<use>admin</use>
|
| 59 |
+
<args>
|
| 60 |
+
<module>Bc_Deliverydate</module>
|
| 61 |
+
<frontName>deliverydate</frontName>
|
| 62 |
+
</args>
|
| 63 |
+
</deliverydate>
|
| 64 |
+
</routers>
|
| 65 |
+
</admin>
|
| 66 |
+
<adminhtml>
|
| 67 |
+
<!--<menu>
|
| 68 |
+
<deliverydate module="deliverydate">
|
| 69 |
+
<title>Deliverydate</title>
|
| 70 |
+
<sort_order>71</sort_order>
|
| 71 |
+
<children>
|
| 72 |
+
<items module="deliverydate">
|
| 73 |
+
<title>Manage Items</title>
|
| 74 |
+
<sort_order>0</sort_order>
|
| 75 |
+
<action>deliverydate/adminhtml_deliverydate</action>
|
| 76 |
+
</items>
|
| 77 |
+
</children>
|
| 78 |
+
</deliverydate>
|
| 79 |
+
</menu>-->
|
| 80 |
+
<acl>
|
| 81 |
+
<resources>
|
| 82 |
+
<all>
|
| 83 |
+
<title>Allow Everything</title>
|
| 84 |
+
</all>
|
| 85 |
+
<admin>
|
| 86 |
+
<children>
|
| 87 |
+
<Bc_Deliverydate>
|
| 88 |
+
<title>Deliverydate Module</title>
|
| 89 |
+
<sort_order>10</sort_order>
|
| 90 |
+
</Bc_Deliverydate>
|
| 91 |
+
<system>
|
| 92 |
+
<children>
|
| 93 |
+
<config>
|
| 94 |
+
<children>
|
| 95 |
+
<deliverydate>
|
| 96 |
+
<title>Delivery Date</title>
|
| 97 |
+
</deliverydate>
|
| 98 |
+
</children>
|
| 99 |
+
</config>
|
| 100 |
+
</children>
|
| 101 |
+
</system>
|
| 102 |
+
</children>
|
| 103 |
+
</admin>
|
| 104 |
+
</resources>
|
| 105 |
+
</acl>
|
| 106 |
+
<layout>
|
| 107 |
+
<updates>
|
| 108 |
+
<deliverydate>
|
| 109 |
+
<file>deliverydate.xml</file>
|
| 110 |
+
</deliverydate>
|
| 111 |
+
</updates>
|
| 112 |
+
</layout>
|
| 113 |
+
<events>
|
| 114 |
+
<sales_order_save_after>
|
| 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_after>
|
| 123 |
+
|
| 124 |
+
</events>
|
| 125 |
+
</adminhtml>
|
| 126 |
+
<global>
|
| 127 |
+
<models>
|
| 128 |
+
<deliverydate>
|
| 129 |
+
<class>Bc_Deliverydate_Model</class>
|
| 130 |
+
<resourceModel>deliverydate_mysql4</resourceModel>
|
| 131 |
+
</deliverydate>
|
| 132 |
+
<deliverydate_mysql4>
|
| 133 |
+
<class>Bc_Deliverydate_Model_Mysql4</class>
|
| 134 |
+
<entities>
|
| 135 |
+
<deliverydate>
|
| 136 |
+
<table>deliverydate</table>
|
| 137 |
+
</deliverydate>
|
| 138 |
+
</entities>
|
| 139 |
+
</deliverydate_mysql4>
|
| 140 |
+
</models>
|
| 141 |
+
<resources>
|
| 142 |
+
<deliverydate_setup>
|
| 143 |
+
<setup>
|
| 144 |
+
<module>Bc_Deliverydate</module>
|
| 145 |
+
</setup>
|
| 146 |
+
<connection>
|
| 147 |
+
<use>core_setup</use>
|
| 148 |
+
</connection>
|
| 149 |
+
</deliverydate_setup>
|
| 150 |
+
<deliverydate_write>
|
| 151 |
+
<connection>
|
| 152 |
+
<use>core_write</use>
|
| 153 |
+
</connection>
|
| 154 |
+
</deliverydate_write>
|
| 155 |
+
<deliverydate_read>
|
| 156 |
+
<connection>
|
| 157 |
+
<use>core_read</use>
|
| 158 |
+
</connection>
|
| 159 |
+
</deliverydate_read>
|
| 160 |
+
</resources>
|
| 161 |
+
<blocks>
|
| 162 |
+
<deliverydate>
|
| 163 |
+
<class>Bc_Deliverydate_Block</class>
|
| 164 |
+
</deliverydate>
|
| 165 |
+
<sales>
|
| 166 |
+
<rewrite>
|
| 167 |
+
<order_info>Bc_Deliverydate_Block_Order_Info</order_info>
|
| 168 |
+
</rewrite>
|
| 169 |
+
</sales>
|
| 170 |
+
</blocks>
|
| 171 |
+
<helpers>
|
| 172 |
+
<deliverydate>
|
| 173 |
+
<class>Bc_Deliverydate_Helper</class>
|
| 174 |
+
</deliverydate>
|
| 175 |
+
</helpers>
|
| 176 |
+
<default>
|
| 177 |
+
<deliverydate>
|
| 178 |
+
<deliverydate_general>
|
| 179 |
+
<enabled>0</enabled>
|
| 180 |
+
<on_which_page>1</on_which_page>
|
| 181 |
+
<deliverydate_html>Please choose your preferrable future delivery time for current #order.</deliverydate_html>
|
| 182 |
+
<deliverydate_format>d/M/Y</deliverydate_format>
|
| 183 |
+
<deliverytime_format>g:i a</deliverytime_format>
|
| 184 |
+
<deliverydate_dayoff></deliverydate_dayoff>
|
| 185 |
+
</deliverydate_general>
|
| 186 |
+
</deliverydate>
|
| 187 |
+
</default>
|
| 188 |
+
</global>
|
| 189 |
</config>
|
app/design/frontend/default/default/layout/deliverydate.xml
CHANGED
|
@@ -36,6 +36,22 @@
|
|
| 36 |
</block>
|
| 37 |
</reference>
|
| 38 |
</checkout_onepage_review>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
<deliverydate_email_information>
|
| 40 |
<block type="deliverydate/email_info" name="deliverydate_email_info" template="deliverydate/email/info.phtml"/>
|
| 41 |
</deliverydate_email_information>
|
| 36 |
</block>
|
| 37 |
</reference>
|
| 38 |
</checkout_onepage_review>
|
| 39 |
+
|
| 40 |
+
<paypal_express_review>
|
| 41 |
+
|
| 42 |
+
<reference name="head">
|
| 43 |
+
<action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action>
|
| 44 |
+
<action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
|
| 45 |
+
<action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
|
| 46 |
+
</reference>
|
| 47 |
+
<reference name="content">
|
| 48 |
+
<reference name="paypal.express.review.details.agreements">
|
| 49 |
+
<action method="setTemplate" ifconfig="deliverydate/deliverydate_general/enabled"><template>deliverydate/agreements.phtml</template></action>
|
| 50 |
+
</reference>
|
| 51 |
+
</reference>
|
| 52 |
+
|
| 53 |
+
</paypal_express_review>
|
| 54 |
+
|
| 55 |
<deliverydate_email_information>
|
| 56 |
<block type="deliverydate/email_info" name="deliverydate_email_info" template="deliverydate/email/info.phtml"/>
|
| 57 |
</deliverydate_email_information>
|
app/design/frontend/default/default/template/deliverydate/agreements.phtml
CHANGED
|
@@ -37,9 +37,11 @@
|
|
| 37 |
<form action="" id="checkout-agreements" onsubmit="return false;">
|
| 38 |
<div class="buttons-set arrival-info">
|
| 39 |
<?php
|
| 40 |
-
if
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
}
|
| 44 |
?>
|
| 45 |
</div>
|
|
@@ -64,5 +66,5 @@
|
|
| 64 |
</ol>
|
| 65 |
</form>
|
| 66 |
<script type="text/javascript">
|
| 67 |
-
|
| 68 |
</script>
|
| 37 |
<form action="" id="checkout-agreements" onsubmit="return false;">
|
| 38 |
<div class="buttons-set arrival-info">
|
| 39 |
<?php
|
| 40 |
+
if(Mage::getStoreConfig('deliverydate/deliverydate_general/enabled')){
|
| 41 |
+
if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==2){
|
| 42 |
+
echo $this->getLayout()->createBlock('core/html_calendar')->setTemplate('deliverydate/js/calendar.phtml')->toHtml() ;
|
| 43 |
+
echo $this->getLayout()->createBlock('deliverydate/deliverydate')->setTemplate('deliverydate/deliverydate.phtml')->toHtml();
|
| 44 |
+
}
|
| 45 |
}
|
| 46 |
?>
|
| 47 |
</div>
|
| 66 |
</ol>
|
| 67 |
</form>
|
| 68 |
<script type="text/javascript">
|
| 69 |
+
|
| 70 |
</script>
|
app/design/frontend/default/default/template/deliverydate/deliverydate.phtml
CHANGED
|
@@ -1,264 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<?php
|
| 2 |
$dayoff = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_dayoff');
|
| 3 |
?>
|
| 4 |
-
<dd>
|
| 5 |
-
<script type="text/javascript">
|
| 6 |
-
//<![CDATA[
|
| 7 |
-
/*Calendar.setup({
|
| 8 |
-
inputField: "shipping_arrival_date",
|
| 9 |
-
ifFormat: "%m/%e/%Y",
|
| 10 |
-
showsTime: false,
|
| 11 |
-
button: "shipping_arrival_date_trig",
|
| 12 |
-
align: "Bl",
|
| 13 |
-
singleClick : true ,
|
| 14 |
-
disableFunc: function(date) {
|
| 15 |
-
return date.getMonth() === 1; // Sunday is 0, Monday is 1, and so on
|
| 16 |
-
}
|
| 17 |
-
});*/
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
}
|
| 33 |
-
this.firstDayOfWeek = firstDayOfWeek;
|
| 34 |
-
this.date = new CalendarDateObject(date);
|
| 35 |
-
var month = date.getMonth();
|
| 36 |
-
var mday = date.getDate();
|
| 37 |
-
var no_days = date.getMonthDays();
|
| 38 |
-
/* Added By B.C. on date 18/02/2013 */
|
| 39 |
-
var check_flag = false;
|
| 40 |
-
/* END */
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
} else {
|
| 84 |
-
cell.
|
| 85 |
-
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
-
|
| 88 |
-
cell.
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
cell.disabled = true;
|
| 101 |
-
|
| 102 |
-
if (/disabled/i.test(status))
|
| 103 |
-
cell.disabled = true;
|
| 104 |
-
cell.className += " " + status;
|
| 105 |
-
}
|
| 106 |
}
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
}
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
/* END */
|
| 136 |
}
|
|
|
|
|
|
|
| 137 |
}
|
| 138 |
-
if (!(hasdays || this.showsOtherMonths))
|
| 139 |
-
row.className = "emptyrow";
|
| 140 |
}
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
|
| 167 |
|
| 168 |
-
currentTime = new Date(calendar.date.getTime());
|
| 169 |
-
var d1=currentTime.getDate();
|
| 170 |
-
var m1=parseInt(currentTime.getMonth())+parseInt(1);
|
| 171 |
-
var y1=currentTime.getFullYear();
|
| 172 |
-
var h1 = currentTime.getHours();
|
| 173 |
-
var min1= currentTime.getMinutes();
|
| 174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
| 177 |
{
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
document.getElementById('shipping_arrival_date').value="";
|
| 183 |
-
calendar.hide();
|
| 184 |
-
}
|
| 185 |
-
else
|
| 186 |
-
{
|
| 187 |
-
document.getElementById('shipping_arrival_date_display').value=y1+"-"+m1+"-"+d1+" "+h1+":"+min1;
|
| 188 |
-
document.getElementById('shipping_arrival_date').value=y1+"-"+m1+"-"+d1+" "+h1+":"+min1;
|
| 189 |
-
calendar.hide();
|
| 190 |
-
}
|
| 191 |
}
|
| 192 |
else
|
| 193 |
{
|
| 194 |
-
|
|
|
|
|
|
|
| 195 |
}
|
| 196 |
-
}
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
|
| 203 |
-
|
| 204 |
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
}
|
| 216 |
-
return true;
|
| 217 |
}
|
|
|
|
| 218 |
}
|
| 219 |
}
|
|
|
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
}
|
| 225 |
-
else if(m1 > m && y==y1)
|
| 226 |
-
{
|
| 227 |
-
return true;
|
| 228 |
-
}
|
| 229 |
}
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
</script>
|
| 253 |
-
<ul style="border-top: 1px solid #D1D1D1; margin-top: 12px; padding-top: 10px;">
|
| 254 |
-
<li>
|
| 255 |
-
<label for="page_date-end">Delivery Date:</label>
|
| 256 |
-
<input name="shipping_arrival_date_display" id="shipping_arrival_date_display" value="" title="date" class=" input-text" style="width: 100px;" type="text"> <img src="<?php echo Mage::getBaseUrl('skin')?>adminhtml/default/default/images/grid-cal.gif" alt="" class="v-middle" id="shipping_arrival_date_trig" title="Select Date" style=""> <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>
|
| 257 |
-
<input name="shipping_arrival_date" id="shipping_arrival_date" value="" onChange="shippingArrivalDateOnChange(this); return false;" title="date" type="hidden">
|
| 258 |
-
</li>
|
| 259 |
-
<li>
|
| 260 |
-
<label for="shipping_arrival_comments">Delivery Comments:</label><br/>
|
| 261 |
-
<textarea cols="65" rows="8" name="shipping_arrival_comments" id="shipping_arrival_comments"></textarea></li>
|
| 262 |
-
<li> <i><?php echo Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_html'); ?></i>
|
| 263 |
-
</li>
|
| 264 |
-
</dd>
|
| 1 |
+
<dd>
|
| 2 |
+
<ul style="border-top: 1px solid #D1D1D1; margin-top: 12px; padding-top: 10px;">
|
| 3 |
+
<li>
|
| 4 |
+
<label for="page_date-end">Delivery Date:</label>
|
| 5 |
+
<input name="shipping_arrival_date_display" id="shipping_arrival_date_display" value="" title="date" class=" input-text" style="width: 100px;" type="text"> <img src="<?php echo Mage::getBaseUrl('skin')?>adminhtml/default/default/images/grid-cal.gif" alt="" class="v-middle" id="shipping_arrival_date_trig" title="Select Date" style=""> <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>
|
| 6 |
+
<input name="shipping_arrival_date" id="shipping_arrival_date" value="" onChange="shippingArrivalDateOnChange(this); return false;" title="date" type="hidden">
|
| 7 |
+
</li>
|
| 8 |
+
<li>
|
| 9 |
+
<label for="shipping_arrival_comments">Delivery Comments:</label><br/>
|
| 10 |
+
<textarea cols="65" rows="8" name="shipping_arrival_comments" id="shipping_arrival_comments"></textarea></li>
|
| 11 |
+
<li> <i><?php echo Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_html'); ?></i>
|
| 12 |
+
</li>
|
| 13 |
+
</dd>
|
| 14 |
<?php
|
| 15 |
$dayoff = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_dayoff');
|
| 16 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
<script type="text/javascript">
|
| 19 |
+
//<![CDATA[
|
| 20 |
+
/*Calendar.setup({
|
| 21 |
+
inputField: "shipping_arrival_date",
|
| 22 |
+
ifFormat: "%m/%e/%Y",
|
| 23 |
+
showsTime: false,
|
| 24 |
+
button: "shipping_arrival_date_trig",
|
| 25 |
+
align: "Bl",
|
| 26 |
+
singleClick : true ,
|
| 27 |
+
disableFunc: function(date) {
|
| 28 |
+
return date.getMonth() === 1; // Sunday is 0, Monday is 1, and so on
|
| 29 |
+
}
|
| 30 |
+
});*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
Calendar.prototype._init = function (firstDayOfWeek, date) {
|
| 33 |
+
var today = new CalendarDateObject(),
|
| 34 |
+
TY = today.getFullYear(),
|
| 35 |
+
TM = today.getMonth(),
|
| 36 |
+
TD = today.getDate();
|
| 37 |
+
this.table.style.visibility = "hidden";
|
| 38 |
+
var year = date.getFullYear();
|
| 39 |
+
if (year < this.minYear) {
|
| 40 |
+
year = this.minYear;
|
| 41 |
+
date.setFullYear(year);
|
| 42 |
+
} else if (year > this.maxYear) {
|
| 43 |
+
year = this.maxYear;
|
| 44 |
+
date.setFullYear(year);
|
| 45 |
+
}
|
| 46 |
+
this.firstDayOfWeek = firstDayOfWeek;
|
| 47 |
+
this.date = new CalendarDateObject(date);
|
| 48 |
+
var month = date.getMonth();
|
| 49 |
+
var mday = date.getDate();
|
| 50 |
+
var no_days = date.getMonthDays();
|
| 51 |
+
/* Added By B.C. on date 18/02/2013 */
|
| 52 |
+
var check_flag = false;
|
| 53 |
+
/* END */
|
| 54 |
|
| 55 |
+
// calendar voodoo for computing the first day that would actually be
|
| 56 |
+
// displayed in the calendar, even if it's from the previous month.
|
| 57 |
+
// WARNING: this is magic. ;-)
|
| 58 |
+
date.setDate(1);
|
| 59 |
+
var day1 = (date.getDay() - this.firstDayOfWeek) % 7;
|
| 60 |
+
if (day1 < 0)
|
| 61 |
+
day1 += 7;
|
| 62 |
+
date.setDate(-day1);
|
| 63 |
+
date.setDate(date.getDate() + 1);
|
| 64 |
+
|
| 65 |
+
var row = this.tbody.firstChild;
|
| 66 |
+
var MN = Calendar._SMN[month];
|
| 67 |
+
var ar_days = this.ar_days = new Array();
|
| 68 |
+
var weekend = Calendar._TT["WEEKEND"];
|
| 69 |
+
var dates = this.multiple ? (this.datesCells = {}) : null;
|
| 70 |
+
for (var i = 0; i < 6; ++i, row = row.nextSibling) {
|
| 71 |
+
var cell = row.firstChild;
|
| 72 |
+
if (this.weekNumbers) {
|
| 73 |
+
cell.className = "day wn";
|
| 74 |
+
cell.innerHTML = date.getWeekNumber();
|
| 75 |
+
cell = cell.nextSibling;
|
| 76 |
+
}
|
| 77 |
+
row.className = "daysrow";
|
| 78 |
+
var hasdays = false, iday, dpos = ar_days[i] = [];
|
| 79 |
+
for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) {
|
| 80 |
+
iday = date.getDate();
|
| 81 |
+
var wday = date.getDay();
|
| 82 |
+
cell.className = "day";
|
| 83 |
+
cell.pos = i << 4 | j;
|
| 84 |
+
dpos[j] = cell;
|
| 85 |
+
var current_month = (date.getMonth() == month);
|
| 86 |
+
if (!current_month) {
|
| 87 |
+
if (this.showsOtherMonths) {
|
| 88 |
+
cell.className += " othermonth";
|
| 89 |
+
cell.otherMonth = true;
|
| 90 |
} else {
|
| 91 |
+
cell.className = "emptycell";
|
| 92 |
+
cell.innerHTML = " ";
|
| 93 |
+
cell.disabled = true;
|
| 94 |
+
continue;
|
| 95 |
}
|
| 96 |
+
} else {
|
| 97 |
+
cell.otherMonth = false;
|
| 98 |
+
hasdays = true;
|
| 99 |
+
}
|
| 100 |
+
cell.disabled = false;
|
| 101 |
+
cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday;
|
| 102 |
+
if (dates)
|
| 103 |
+
dates[date.print("%Y%m%d")] = cell;
|
| 104 |
+
if (this.getDateStatus) {
|
| 105 |
+
var status = this.getDateStatus(date, year, month, iday);
|
| 106 |
+
if (this.getDateToolTip) {
|
| 107 |
+
var toolTip = this.getDateToolTip(date, year, month, iday);
|
| 108 |
+
if (toolTip)
|
| 109 |
+
cell.title = toolTip;
|
| 110 |
+
}
|
| 111 |
+
if (status === true) {
|
| 112 |
+
cell.className += " disabled";
|
| 113 |
+
cell.disabled = true;
|
| 114 |
+
} else {
|
| 115 |
+
if (/disabled/i.test(status))
|
| 116 |
cell.disabled = true;
|
| 117 |
+
cell.className += " " + status;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
}
|
| 119 |
+
}
|
| 120 |
+
if (!cell.disabled) {
|
| 121 |
+
cell.caldate = new CalendarDateObject(date);
|
| 122 |
+
cell.ttip = "_";
|
| 123 |
+
if (!this.multiple && current_month
|
| 124 |
+
&& iday == mday && this.hiliteToday) {
|
| 125 |
+
cell.className += " selected";
|
| 126 |
+
this.currentDateEl = cell;
|
| 127 |
+
}
|
| 128 |
+
if (date.getFullYear() == TY &&
|
| 129 |
+
date.getMonth() == TM &&
|
| 130 |
+
iday == TD) {
|
| 131 |
+
cell.className += " today";
|
| 132 |
+
cell.ttip += Calendar._TT["PART_TODAY"];
|
| 133 |
+
}
|
| 134 |
+
if (weekend.indexOf(wday.toString()) != -1)
|
| 135 |
+
cell.className += cell.otherMonth ? " oweekend" : " weekend";
|
| 136 |
+
if (check_flag){
|
| 137 |
+
cell.className += " selected";
|
| 138 |
+
this.currentDateEl = cell;
|
| 139 |
+
check_flag=false;
|
| 140 |
+
}
|
| 141 |
+
}else{
|
| 142 |
+
/* Added By B.C. on date 18/02/2013 */
|
| 143 |
+
if (!this.multiple && current_month
|
| 144 |
+
&& iday == mday && this.hiliteToday) {
|
| 145 |
+
check_flag=true;
|
|
|
|
|
|
|
| 146 |
}
|
| 147 |
+
|
| 148 |
+
/* END */
|
| 149 |
}
|
|
|
|
|
|
|
| 150 |
}
|
| 151 |
+
if (!(hasdays || this.showsOtherMonths))
|
| 152 |
+
row.className = "emptyrow";
|
| 153 |
+
}
|
| 154 |
+
this.title.innerHTML = Calendar._MN[month] + ", " + year;
|
| 155 |
+
this.onSetTime();
|
| 156 |
+
this.table.style.visibility = "visible";
|
| 157 |
+
this._initMultipleDates();
|
| 158 |
+
// PROFILE
|
| 159 |
+
// this.tooltips.innerHTML = "Generated in " + ((new CalendarDateObject()) - today) + " ms";
|
| 160 |
+
};
|
| 161 |
|
| 162 |
+
var dayoff = '<?php echo $dayoff; ?>';
|
| 163 |
+
var test_flag = false;
|
| 164 |
+
Calendar.setup({
|
| 165 |
+
inputField: "shipping_arrival_date",
|
| 166 |
+
ifFormat: "%Y-%mm-%ee %H:%M:%S",
|
| 167 |
+
showsTime: true,
|
| 168 |
+
button: "shipping_arrival_date_trig",
|
| 169 |
+
align: "Bl",
|
| 170 |
+
singleClick :true,
|
| 171 |
+
onSelect :function()
|
| 172 |
+
{
|
| 173 |
+
//var y = calendar.date.getFullYear();
|
| 174 |
+
currentTime1 = new Date();
|
| 175 |
+
var m = parseInt(currentTime1.getMonth())+parseInt(1);
|
| 176 |
+
var y=currentTime1.getFullYear();
|
| 177 |
+
var d = currentTime1.getDate();
|
|
|
|
| 178 |
|
| 179 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
|
| 181 |
+
currentTime = new Date(calendar.date.getTime());
|
| 182 |
+
var d1=currentTime.getDate();
|
| 183 |
+
var m1=parseInt(currentTime.getMonth())+parseInt(1);
|
| 184 |
+
var y1=currentTime.getFullYear();
|
| 185 |
+
var h1 = currentTime.getHours();
|
| 186 |
+
var min1= currentTime.getMinutes();
|
| 187 |
|
| 188 |
+
|
| 189 |
+
if (calendar.dateClicked)
|
| 190 |
+
{
|
| 191 |
+
if(d1 < d && m1==m && y1==y)
|
| 192 |
{
|
| 193 |
+
alert("You can not select previous date.")
|
| 194 |
+
document.getElementById('shipping_arrival_date_display').value="";
|
| 195 |
+
document.getElementById('shipping_arrival_date').value="";
|
| 196 |
+
calendar.hide();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
}
|
| 198 |
else
|
| 199 |
{
|
| 200 |
+
document.getElementById('shipping_arrival_date_display').value=y1+"-"+m1+"-"+d1+" "+h1+":"+min1;
|
| 201 |
+
document.getElementById('shipping_arrival_date').value=y1+"-"+m1+"-"+d1+" "+h1+":"+min1;
|
| 202 |
+
calendar.hide();
|
| 203 |
}
|
| 204 |
+
}
|
| 205 |
+
else
|
| 206 |
+
{
|
| 207 |
+
calendar.show();
|
| 208 |
+
}
|
| 209 |
+
},
|
| 210 |
+
disableFunc : function(date)
|
| 211 |
+
{
|
| 212 |
+
var y = calendar.date.getFullYear();
|
| 213 |
+
var m = calendar.date.getMonth();
|
| 214 |
+
var d = calendar.date.getDate();
|
| 215 |
|
| 216 |
+
var day_off_array = dayoff.split(",") ;
|
| 217 |
|
| 218 |
+
currentTime = new Date();
|
| 219 |
+
var d1=currentTime.getDate();
|
| 220 |
+
var m1=currentTime.getMonth();
|
| 221 |
+
var y1=currentTime.getFullYear();
|
| 222 |
+
var counter = 1;
|
| 223 |
+
for (var i=0; i<day_off_array.length;i++){
|
| 224 |
+
if (day_off_array[i]>=0 && day_off_array[i]!=''){
|
| 225 |
+
if (date.getDay()==day_off_array[i]){
|
| 226 |
+
if (date.getDate()==currentTime.getDate()){
|
| 227 |
+
test_flag=true;
|
|
|
|
|
|
|
| 228 |
}
|
| 229 |
+
return true;
|
| 230 |
}
|
| 231 |
}
|
| 232 |
+
}
|
| 233 |
|
| 234 |
+
if(y < y1)
|
| 235 |
+
{
|
| 236 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 237 |
}
|
| 238 |
+
else if(m1 > m && y==y1)
|
| 239 |
+
{
|
| 240 |
+
return true;
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
});
|
| 244 |
|
| 245 |
+
function shippingArrivalDateOnChange(el)
|
| 246 |
+
{
|
| 247 |
+
var displayDate = $('shipping_arrival_date_display');
|
| 248 |
+
var date = $('shipping_arrival_date').getValue();
|
| 249 |
+
displayDate.setValue(date);
|
| 250 |
+
}
|
| 251 |
|
| 252 |
+
function resetArrivalDate()
|
| 253 |
+
{
|
| 254 |
+
//clear both fields
|
| 255 |
|
| 256 |
+
}
|
| 257 |
+
//MRD added disable field to only allow calendar input
|
| 258 |
+
//TODO: need to enable field when form is submitted
|
| 259 |
+
Form.Element.disable('shipping_arrival_date_display');
|
| 260 |
+
Event.observe($('link_reset'),'click',function(){
|
| 261 |
+
$('shipping_arrival_date').setValue('');
|
| 262 |
+
$('shipping_arrival_date_display').setValue('');
|
| 263 |
+
});
|
| 264 |
+
//]]>
|
| 265 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/default/default/template/deliverydate/review/info.phtml
CHANGED
|
@@ -69,12 +69,7 @@
|
|
| 69 |
</script>
|
| 70 |
<div id="checkout-review-submit">
|
| 71 |
<?php echo $this->getChildHtml('agreements') ?>
|
| 72 |
-
<?php
|
| 73 |
-
$get_ver = Mage::getVersion();
|
| 74 |
-
$ver = str_replace('.','',$get_ver);
|
| 75 |
-
if($ver >1411)
|
| 76 |
-
{
|
| 77 |
-
?>
|
| 78 |
<div class="buttons-set" id="review-buttons-container">
|
| 79 |
|
| 80 |
<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>
|
|
@@ -84,9 +79,7 @@
|
|
| 84 |
<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...') ?>
|
| 85 |
</span>
|
| 86 |
</div>
|
| 87 |
-
<?php
|
| 88 |
-
}
|
| 89 |
-
?>
|
| 90 |
<script type="text/javascript">
|
| 91 |
//<