SoftProdigy_DeliveryDate - Version 1.0.0

Version Notes

This Extension helps to keep a track of shipping and delivery dates of products for e-commerce stores.

Download this release

Release Info

Developer SoftProdigyIN
Extension SoftProdigy_DeliveryDate
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

Files changed (39) hide show
  1. app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate.php +26 -0
  2. app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit.php +58 -0
  3. app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit/Form.php +32 -0
  4. app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit/Tab/Form.php +71 -0
  5. app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit/Tabs.php +37 -0
  6. app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Grid.php +121 -0
  7. app/code/local/Softprodigy/Deliverydate/Block/Deliverydate.php +35 -0
  8. app/code/local/Softprodigy/Deliverydate/Block/Email/Info.php +20 -0
  9. app/code/local/Softprodigy/Deliverydate/Block/Order/Info.php +116 -0
  10. app/code/local/Softprodigy/Deliverydate/Helper/Data.php +80 -0
  11. app/code/local/Softprodigy/Deliverydate/Model/Config/Dateformat.php +40 -0
  12. app/code/local/Softprodigy/Deliverydate/Model/Config/Dayoff.php +62 -0
  13. app/code/local/Softprodigy/Deliverydate/Model/Config/Option.php +34 -0
  14. app/code/local/Softprodigy/Deliverydate/Model/Config/Timeformat.php +32 -0
  15. app/code/local/Softprodigy/Deliverydate/Model/Deliverydate.php +33 -0
  16. app/code/local/Softprodigy/Deliverydate/Model/Mysql4/Deliverydate.php +23 -0
  17. app/code/local/Softprodigy/Deliverydate/Model/Mysql4/Deliverydate/Collection.php +23 -0
  18. app/code/local/Softprodigy/Deliverydate/Model/Observer.php +34 -0
  19. app/code/local/Softprodigy/Deliverydate/Model/Status.php +28 -0
  20. app/code/local/Softprodigy/Deliverydate/controllers/Adminhtml/DeliverydateController.php +227 -0
  21. app/code/local/Softprodigy/Deliverydate/controllers/IndexController.php +23 -0
  22. app/code/local/Softprodigy/Deliverydate/etc/config.xml +182 -0
  23. app/code/local/Softprodigy/Deliverydate/etc/system.xml +106 -0
  24. app/code/local/Softprodigy/Deliverydate/sql/deliverydate_setup/mysql4-install-0.1.0.php +41 -0
  25. app/design/adminhtml/default/default/layout/deliverydate.xml +38 -0
  26. app/design/adminhtml/default/default/template/deliverydate/date.phtml +44 -0
  27. app/design/adminhtml/default/default/template/deliverydate/info.phtml +149 -0
  28. app/design/adminhtml/default/default/template/deliverydate/js/calendar.phtml +84 -0
  29. app/design/frontend/default/default/layout/deliverydate.xml +73 -0
  30. app/design/frontend/default/default/template/deliverydate/agreements.phtml +59 -0
  31. app/design/frontend/default/default/template/deliverydate/deliverydate.phtml +262 -0
  32. app/design/frontend/default/default/template/deliverydate/email/info.phtml +32 -0
  33. app/design/frontend/default/default/template/deliverydate/js/calendar.phtml +84 -0
  34. app/design/frontend/default/default/template/deliverydate/order/info.phtml +113 -0
  35. app/design/frontend/default/default/template/deliverydate/review/info.phtml +77 -0
  36. app/design/frontend/default/default/template/deliverydate/shipping_method/available.phtml +96 -0
  37. package.xml +20 -0
  38. skin/adminhtml/default/default/images/ico_reset.png +0 -0
  39. skin/frontend/default/default/images/ico_reset.png +0 -0
app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Adminhtml_Deliverydate extends Mage_Adminhtml_Block_Widget_Grid_Container
17
+ {
18
+ public function __construct()
19
+ {
20
+ $this->_controller = 'adminhtml_deliverydate';
21
+ $this->_blockGroup = 'deliverydate';
22
+ $this->_headerText = Mage::helper('deliverydate')->__('Item Manager');
23
+ $this->_addButtonLabel = Mage::helper('deliverydate')->__('Add Item');
24
+ parent::__construct();
25
+ }
26
+ }
app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Adminhtml_Deliverydate_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
17
+ {
18
+ public function __construct()
19
+ {
20
+ parent::__construct();
21
+
22
+ $this->_objectId = 'id';
23
+ $this->_blockGroup = 'deliverydate';
24
+ $this->_controller = 'adminhtml_deliverydate';
25
+
26
+ $this->_updateButton('save', 'label', Mage::helper('deliverydate')->__('Save Item'));
27
+ $this->_updateButton('delete', 'label', Mage::helper('deliverydate')->__('Delete Item'));
28
+
29
+ $this->_addButton('saveandcontinue', array(
30
+ 'label' => Mage::helper('adminhtml')->__('Save And Continue Edit'),
31
+ 'onclick' => 'saveAndContinueEdit()',
32
+ 'class' => 'save',
33
+ ), -100);
34
+
35
+ $this->_formScripts[] = "
36
+ function toggleEditor() {
37
+ if (tinyMCE.getInstanceById('deliverydate_content') == null) {
38
+ tinyMCE.execCommand('mceAddControl', false, 'deliverydate_content');
39
+ } else {
40
+ tinyMCE.execCommand('mceRemoveControl', false, 'deliverydate_content');
41
+ }
42
+ }
43
+
44
+ function saveAndContinueEdit(){
45
+ editForm.submit($('edit_form').action+'back/edit/');
46
+ }
47
+ ";
48
+ }
49
+
50
+ public function getHeaderText()
51
+ {
52
+ if( Mage::registry('deliverydate_data') && Mage::registry('deliverydate_data')->getId() ) {
53
+ return Mage::helper('deliverydate')->__("Edit Item '%s'", $this->htmlEscape(Mage::registry('deliverydate_data')->getTitle()));
54
+ } else {
55
+ return Mage::helper('deliverydate')->__('Add Item');
56
+ }
57
+ }
58
+ }
app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit/Form.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Adminhtml_Deliverydate_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
17
+ {
18
+ protected function _prepareForm()
19
+ {
20
+ $form = new Varien_Data_Form(array(
21
+ 'id' => 'edit_form',
22
+ 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),
23
+ 'method' => 'post',
24
+ 'enctype' => 'multipart/form-data'
25
+ )
26
+ );
27
+
28
+ $form->setUseContainer(true);
29
+ $this->setForm($form);
30
+ return parent::_prepareForm();
31
+ }
32
+ }
app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit/Tab/Form.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Adminhtml_Deliverydate_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
17
+ {
18
+ protected function _prepareForm()
19
+ {
20
+ $form = new Varien_Data_Form();
21
+ $this->setForm($form);
22
+ $fieldset = $form->addFieldset('deliverydate_form', array('legend'=>Mage::helper('deliverydate')->__('Item information')));
23
+
24
+ $fieldset->addField('title', 'text', array(
25
+ 'label' => Mage::helper('deliverydate')->__('Title'),
26
+ 'class' => 'required-entry',
27
+ 'required' => true,
28
+ 'name' => 'title',
29
+ ));
30
+
31
+ $fieldset->addField('filename', 'file', array(
32
+ 'label' => Mage::helper('deliverydate')->__('File'),
33
+ 'required' => false,
34
+ 'name' => 'filename',
35
+ ));
36
+
37
+ $fieldset->addField('status', 'select', array(
38
+ 'label' => Mage::helper('deliverydate')->__('Status'),
39
+ 'name' => 'status',
40
+ 'values' => array(
41
+ array(
42
+ 'value' => 1,
43
+ 'label' => Mage::helper('deliverydate')->__('Enabled'),
44
+ ),
45
+
46
+ array(
47
+ 'value' => 2,
48
+ 'label' => Mage::helper('deliverydate')->__('Disabled'),
49
+ ),
50
+ ),
51
+ ));
52
+
53
+ $fieldset->addField('content', 'editor', array(
54
+ 'name' => 'content',
55
+ 'label' => Mage::helper('deliverydate')->__('Content'),
56
+ 'title' => Mage::helper('deliverydate')->__('Content'),
57
+ 'style' => 'width:700px; height:500px;',
58
+ 'wysiwyg' => false,
59
+ 'required' => true,
60
+ ));
61
+
62
+ if ( Mage::getSingleton('adminhtml/session')->getDeliverydateData() )
63
+ {
64
+ $form->setValues(Mage::getSingleton('adminhtml/session')->getDeliverydateData());
65
+ Mage::getSingleton('adminhtml/session')->setDeliverydateData(null);
66
+ } elseif ( Mage::registry('deliverydate_data') ) {
67
+ $form->setValues(Mage::registry('deliverydate_data')->getData());
68
+ }
69
+ return parent::_prepareForm();
70
+ }
71
+ }
app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Edit/Tabs.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Adminhtml_Deliverydate_Edit_Tabs extends Mage_Adminhtml_Block_Widget_Tabs
17
+ {
18
+
19
+ public function __construct()
20
+ {
21
+ parent::__construct();
22
+ $this->setId('deliverydate_tabs');
23
+ $this->setDestElementId('edit_form');
24
+ $this->setTitle(Mage::helper('deliverydate')->__('Item Information'));
25
+ }
26
+
27
+ protected function _beforeToHtml()
28
+ {
29
+ $this->addTab('form_section', array(
30
+ 'label' => Mage::helper('deliverydate')->__('Item Information'),
31
+ 'title' => Mage::helper('deliverydate')->__('Item Information'),
32
+ 'content' => $this->getLayout()->createBlock('deliverydate/adminhtml_deliverydate_edit_tab_form')->toHtml(),
33
+ ));
34
+
35
+ return parent::_beforeToHtml();
36
+ }
37
+ }
app/code/local/Softprodigy/Deliverydate/Block/Adminhtml/Deliverydate/Grid.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Adminhtml_Deliverydate_Grid extends Mage_Adminhtml_Block_Widget_Grid
17
+ {
18
+ public function __construct()
19
+ {
20
+ parent::__construct();
21
+ $this->setId('deliverydateGrid');
22
+ $this->setDefaultSort('deliverydate_id');
23
+ $this->setDefaultDir('ASC');
24
+ $this->setSaveParametersInSession(true);
25
+ }
26
+
27
+ protected function _prepareCollection()
28
+ {
29
+ $collection = Mage::getModel('deliverydate/deliverydate')->getCollection();
30
+ $this->setCollection($collection);
31
+ return parent::_prepareCollection();
32
+ }
33
+
34
+ protected function _prepareColumns()
35
+ {
36
+ $this->addColumn('deliverydate_id', array(
37
+ 'header' => Mage::helper('deliverydate')->__('ID'),
38
+ 'align' =>'right',
39
+ 'width' => '50px',
40
+ 'index' => 'deliverydate_id',
41
+ ));
42
+
43
+ $this->addColumn('title', array(
44
+ 'header' => Mage::helper('deliverydate')->__('Title'),
45
+ 'align' =>'left',
46
+ 'index' => 'title',
47
+ ));
48
+
49
+ $this->addColumn('status', array(
50
+ 'header' => Mage::helper('deliverydate')->__('Status'),
51
+ 'align' => 'left',
52
+ 'width' => '80px',
53
+ 'index' => 'status',
54
+ 'type' => 'options',
55
+ 'options' => array(
56
+ 1 => 'Enabled',
57
+ 2 => 'Disabled',
58
+ ),
59
+ ));
60
+
61
+ $this->addColumn('action',
62
+ array(
63
+ 'header' => Mage::helper('deliverydate')->__('Action'),
64
+ 'width' => '100',
65
+ 'type' => 'action',
66
+ 'getter' => 'getId',
67
+ 'actions' => array(
68
+ array(
69
+ 'caption' => Mage::helper('deliverydate')->__('Edit'),
70
+ 'url' => array('base'=> '*/*/edit'),
71
+ 'field' => 'id'
72
+ )
73
+ ),
74
+ 'filter' => false,
75
+ 'sortable' => false,
76
+ 'index' => 'stores',
77
+ 'is_system' => true,
78
+ ));
79
+
80
+ $this->addExportType('*/*/exportCsv', Mage::helper('deliverydate')->__('CSV'));
81
+ $this->addExportType('*/*/exportXml', Mage::helper('deliverydate')->__('XML'));
82
+
83
+ return parent::_prepareColumns();
84
+ }
85
+
86
+ protected function _prepareMassaction()
87
+ {
88
+ $this->setMassactionIdField('deliverydate_id');
89
+ $this->getMassactionBlock()->setFormFieldName('deliverydate');
90
+
91
+ $this->getMassactionBlock()->addItem('delete', array(
92
+ 'label' => Mage::helper('deliverydate')->__('Delete'),
93
+ 'url' => $this->getUrl('*/*/massDelete'),
94
+ 'confirm' => Mage::helper('deliverydate')->__('Are you sure?')
95
+ ));
96
+
97
+ $statuses = Mage::getSingleton('deliverydate/status')->getOptionArray();
98
+
99
+ array_unshift($statuses, array('label'=>'', 'value'=>''));
100
+ $this->getMassactionBlock()->addItem('status', array(
101
+ 'label'=> Mage::helper('deliverydate')->__('Change status'),
102
+ 'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
103
+ 'additional' => array(
104
+ 'visibility' => array(
105
+ 'name' => 'status',
106
+ 'type' => 'select',
107
+ 'class' => 'required-entry',
108
+ 'label' => Mage::helper('deliverydate')->__('Status'),
109
+ 'values' => $statuses
110
+ )
111
+ )
112
+ ));
113
+ return $this;
114
+ }
115
+
116
+ public function getRowUrl($row)
117
+ {
118
+ return $this->getUrl('*/*/edit', array('id' => $row->getId()));
119
+ }
120
+
121
+ }
app/code/local/Softprodigy/Deliverydate/Block/Deliverydate.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Deliverydate extends Mage_Core_Block_Template
17
+ {
18
+ public function _prepareLayout()
19
+ {
20
+ return parent::_prepareLayout();
21
+ }
22
+
23
+ public function getDeliverydate()
24
+ {
25
+ if (!$this->hasData('deliverydate')) {
26
+ $this->setData('deliverydate', Mage::registry('deliverydate'));
27
+ }
28
+ return $this->getData('deliverydate');
29
+
30
+ }
31
+ public function getDateFormat()
32
+ {
33
+ return Mage::app()->getLocale()->getDateStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT) . ' ' . Mage::app()->getLocale()->getTimeStrFormat(Mage_Core_Model_Locale::FORMAT_TYPE_SHORT);
34
+ }
35
+ }
app/code/local/Softprodigy/Deliverydate/Block/Email/Info.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Email_Info extends Mage_Sales_Block_Items_Abstract
17
+ {
18
+
19
+ }
20
+ ?>
app/code/local/Softprodigy/Deliverydate/Block/Order/Info.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Block_Order_Info extends Mage_Core_Block_Template
17
+ {
18
+ protected $_links = array();
19
+
20
+ protected function _construct()
21
+ {
22
+ parent::_construct();
23
+ if (Mage::getStoreConfig('deliverydate/deliverydate_general/enabled')){
24
+ $this->setTemplate('deliverydate/order/info.phtml');
25
+ }else{
26
+ $this->setTemplate('sales/order/info.phtml');
27
+ }
28
+ }
29
+
30
+ protected function _prepareLayout()
31
+ {
32
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
33
+ $headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId()));
34
+ }
35
+ $this->setChild(
36
+ 'payment_info',
37
+ $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
38
+ );
39
+ }
40
+
41
+ public function getPaymentInfoHtml()
42
+ {
43
+ return $this->getChildHtml('payment_info');
44
+ }
45
+
46
+ /**
47
+ * Retrieve current order model instance
48
+ *
49
+ * @return Mage_Sales_Model_Order
50
+ */
51
+ public function getOrder()
52
+ {
53
+ return Mage::registry('current_order');
54
+ }
55
+
56
+ public function addLink($name, $path, $label)
57
+ {
58
+ $this->_links[$name] = new Varien_Object(array(
59
+ 'name' => $name,
60
+ 'label' => $label,
61
+ 'url' => empty($path) ? '' : Mage::getUrl($path, array('order_id' => $this->getOrder()->getId()))
62
+ ));
63
+ return $this;
64
+ }
65
+
66
+ public function getLinks()
67
+ {
68
+ $this->checkLinks();
69
+ return $this->_links;
70
+ }
71
+
72
+ private function checkLinks()
73
+ {
74
+ $order = $this->getOrder();
75
+ if (!$order->hasInvoices()) {
76
+ unset($this->_links['invoice']);
77
+ }
78
+ if (!$order->hasShipments()) {
79
+ unset($this->_links['shipment']);
80
+ }
81
+ if (!$order->hasCreditmemos()) {
82
+ unset($this->_links['creditmemo']);
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Get url for reorder action
88
+ *
89
+ * @deprecated after 1.6.0.0, logic moved to new block
90
+ * @param Mage_Sales_Order $order
91
+ * @return string
92
+ */
93
+ public function getReorderUrl($order)
94
+ {
95
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
96
+ return $this->getUrl('sales/guest/reorder', array('order_id' => $order->getId()));
97
+ }
98
+ return $this->getUrl('sales/order/reorder', array('order_id' => $order->getId()));
99
+ }
100
+
101
+ /**
102
+ * Get url for printing order
103
+ *
104
+ * @deprecated after 1.6.0.0, logic moved to new block
105
+ * @param Mage_Sales_Order $order
106
+ * @return string
107
+ */
108
+ public function getPrintUrl($order)
109
+ {
110
+ if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
111
+ return $this->getUrl('sales/guest/print', array('order_id' => $order->getId()));
112
+ }
113
+ return $this->getUrl('sales/order/print', array('order_id' => $order->getId()));
114
+ }
115
+
116
+ }
app/code/local/Softprodigy/Deliverydate/Helper/Data.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Helper_Data extends Mage_Core_Helper_Abstract
17
+ {
18
+ public function getFormatedDeliveryDate($date = null)
19
+ {
20
+ if(empty($date) ||$date == null || $date == '0000-00-00 00:00:00'){
21
+ return Mage::helper('deliverydate')->__("No Delivery Date Specified.");
22
+ }
23
+
24
+ $formatedDate = Mage::helper('core')->formatDate($date, 'medium');
25
+ return $formatedDate;
26
+ }
27
+
28
+ public function getFormatedDeliveryDateToSave($date = null)
29
+ {
30
+ if(empty($date) ||$date == null || $date == '0000-00-00 00:00:00'){
31
+ return null;
32
+ }
33
+
34
+ $timestamp = null;
35
+ try{
36
+ $timestamp = strtotime($date);
37
+ $dateArray = explode("-", $date);
38
+ if(count($dateArray) != 3){
39
+ return null;
40
+ }
41
+ $formatedDate = date('Y-m-d H:i:s',strtotime($date));
42
+ } catch(Exception $e){
43
+ return null;
44
+ }
45
+
46
+ return $formatedDate;
47
+ }
48
+ public function saveShippingArrivalDate($observer){
49
+
50
+ $order = $observer->getEvent()->getOrder();
51
+ if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==2){
52
+ $desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave(Mage::app()->getRequest()->getParam('shipping_arrival_date'));
53
+ if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
54
+ $order->setShippingArrivalComments(Mage::app()->getRequest()->getParam('shipping_arrival_comments'));
55
+ $order->setShippingArrivalDate($desiredArrivalDate);
56
+ }
57
+ }else{
58
+ $cart = Mage::getModel('checkout/cart')->getQuote()->getData();
59
+ $desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($cart['shipping_arrival_date']);
60
+ $shipping_arrival_comments = $cart['shipping_arrival_comments'];
61
+ if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
62
+ $order->setShippingArrivalComments($shipping_arrival_comments);
63
+ $order->setShippingArrivalDate($desiredArrivalDate);
64
+ }
65
+ }
66
+ }
67
+ public function saveShippingArrivalDateAdmin($observer){
68
+
69
+ $order = $observer->getEvent()->getOrder();
70
+ $cart = Mage::app()->getRequest()->getParams();
71
+ $desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($cart['shipping_arrival_date_display']);
72
+ $shipping_arrival_comments = $cart['shipping_arrival_comments'];
73
+ if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
74
+ $order->setShippingArrivalComments($shipping_arrival_comments);
75
+ $order->setShippingArrivalDate($desiredArrivalDate);
76
+ }
77
+
78
+ }
79
+
80
+ }
app/code/local/Softprodigy/Deliverydate/Model/Config/Dateformat.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Config_Dateformat extends Mage_Core_Model_Config_Data
17
+ {
18
+
19
+ /**
20
+ * Get possible sharing configuration options
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ 'd/M/Y' => Mage::helper('deliverydate')->__('d/M/Y'),
28
+ 'M/d/y' => Mage::helper('deliverydate')->__('M/d/y'),
29
+ 'd-M-Y' => Mage::helper('deliverydate')->__('d-M-Y'),
30
+ 'M-d-y' => Mage::helper('deliverydate')->__('M-d-y'),
31
+ 'm.d.y' => Mage::helper('deliverydate')->__('m.d.y'),
32
+ 'd.M.Y' => Mage::helper('deliverydate')->__('d.M.Y'),
33
+ 'M.d.y' => Mage::helper('deliverydate')->__('M.d.y'),
34
+ 'F j ,Y'=> Mage::helper('deliverydate')->__('F j ,Y'),
35
+ 'D M j' => Mage::helper('deliverydate')->__('D M j'),
36
+ 'Y-m-d' => Mage::helper('deliverydate')->__('Y-m-d')
37
+ );
38
+ }
39
+
40
+ }
app/code/local/Softprodigy/Deliverydate/Model/Config/Dayoff.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Config_Dayoff extends Mage_Core_Model_Config_Data
17
+ {
18
+
19
+ /**
20
+ * Get possible sharing configuration options
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ $test_array[7] = array(
27
+ 'value' => '',
28
+ 'label' => Mage::helper('deliverydate')->__('No Day'),
29
+ );
30
+ $test_array[0] = array(
31
+ 'value' => 0,
32
+ 'label' => Mage::helper('deliverydate')->__('Sunday'),
33
+ );
34
+ $test_array[1] = array(
35
+ 'value' => 1,
36
+ 'label' => Mage::helper('deliverydate')->__('Monday'),
37
+ );
38
+ $test_array[2] = array(
39
+ 'value' => 2,
40
+ 'label' => Mage::helper('deliverydate')->__('Tuesday'),
41
+ );
42
+ $test_array[3] = array(
43
+ 'value' => 3,
44
+ 'label' => Mage::helper('deliverydate')->__('Wedenesday'),
45
+ );
46
+ $test_array[4] = array(
47
+ 'value' => 4,
48
+ 'label' => Mage::helper('deliverydate')->__('Thursday'),
49
+ );
50
+ $test_array[5] = array(
51
+ 'value' => 5,
52
+ 'label' => Mage::helper('deliverydate')->__('Friday'),
53
+ );
54
+ $test_array[6] = array(
55
+ 'value' => 6,
56
+ 'label' => Mage::helper('deliverydate')->__('Saturday'),
57
+ );
58
+
59
+ return $test_array;
60
+ }
61
+
62
+ }
app/code/local/Softprodigy/Deliverydate/Model/Config/Option.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Config_Option extends Mage_Core_Model_Config_Data
17
+ {
18
+ const TYPE_SHIPPING_PAGE = 1;
19
+ const TYPE_REVIEW_PAGE = 2;
20
+
21
+ /**
22
+ * Get possible sharing configuration options
23
+ *
24
+ * @return array
25
+ */
26
+ public function toOptionArray()
27
+ {
28
+ return array(
29
+ self::TYPE_SHIPPING_PAGE => Mage::helper('deliverydate')->__('Shipping Method'),
30
+ self::TYPE_REVIEW_PAGE => Mage::helper('deliverydate')->__('Review Page'),
31
+ );
32
+ }
33
+
34
+ }
app/code/local/Softprodigy/Deliverydate/Model/Config/Timeformat.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Config_Timeformat extends Mage_Core_Model_Config_Data
17
+ {
18
+
19
+ /**
20
+ * Get possible sharing configuration options
21
+ *
22
+ * @return array
23
+ */
24
+ public function toOptionArray()
25
+ {
26
+ return array(
27
+ 'g:i a' => Mage::helper('deliverydate')->__('g:i a'),
28
+ 'H:i:s' => Mage::helper('deliverydate')->__('H:i:s')
29
+ );
30
+ }
31
+
32
+ }
app/code/local/Softprodigy/Deliverydate/Model/Deliverydate.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Deliverydate extends Mage_Core_Model_Abstract
17
+ {
18
+ const TYPE_SHIPPING_METHOD = 1;
19
+ const TYPE_REVIEW_PAGE = 2;
20
+ public function _construct()
21
+ {
22
+ parent::_construct();
23
+ $this->_init('deliverydate/deliverydate');
24
+ }
25
+
26
+ public function toOptionArray()
27
+ {
28
+ return array(
29
+ self::TYPE_SHIPPING_METHOD => Mage::helper('adminhtml')->__('Shipping Method'),
30
+ self::TYPE_REVIEW_PAGE => Mage::helper('adminhtml')->__('Order Review Page')
31
+ );
32
+ }
33
+ }
app/code/local/Softprodigy/Deliverydate/Model/Mysql4/Deliverydate.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Mysql4_Deliverydate extends Mage_Core_Model_Mysql4_Abstract
17
+ {
18
+ public function _construct()
19
+ {
20
+ // Note that the deliverydate_id refers to the key field in your database table.
21
+ $this->_init('deliverydate/deliverydate', 'deliverydate_id');
22
+ }
23
+ }
app/code/local/Softprodigy/Deliverydate/Model/Mysql4/Deliverydate/Collection.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Mysql4_Deliverydate_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
17
+ {
18
+ public function _construct()
19
+ {
20
+ parent::_construct();
21
+ $this->_init('deliverydate/deliverydate');
22
+ }
23
+ }
app/code/local/Softprodigy/Deliverydate/Model/Observer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Observer
17
+ {
18
+ public function checkout_controller_onepage_save_shipping_method($observer)
19
+ {
20
+ if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==1){
21
+ $request = $observer->getEvent()->getRequest();
22
+ $quote = $observer->getEvent()->getQuote();
23
+
24
+ $desiredArrivalDate = Mage::helper('deliverydate')->getFormatedDeliveryDateToSave($request->getPost('shipping_arrival_date', ''));
25
+ if (isset($desiredArrivalDate) && !empty($desiredArrivalDate)){
26
+ $quote->setShippingArrivalDate($desiredArrivalDate);
27
+ $quote->setShippingArrivalComments($request->getPost('shipping_arrival_comments'));
28
+ $quote->save();
29
+ }
30
+ }
31
+
32
+ return $this;
33
+ }
34
+ }
app/code/local/Softprodigy/Deliverydate/Model/Status.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Model_Status extends Varien_Object
17
+ {
18
+ const STATUS_ENABLED = 1;
19
+ const STATUS_DISABLED = 2;
20
+
21
+ static public function getOptionArray()
22
+ {
23
+ return array(
24
+ self::STATUS_ENABLED => Mage::helper('deliverydate')->__('Enabled'),
25
+ self::STATUS_DISABLED => Mage::helper('deliverydate')->__('Disabled')
26
+ );
27
+ }
28
+ }
app/code/local/Softprodigy/Deliverydate/controllers/Adminhtml/DeliverydateController.php ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_Adminhtml_DeliverydateController extends Mage_Adminhtml_Controller_action
17
+ {
18
+
19
+ protected function _initAction() {
20
+ $this->loadLayout()
21
+ ->_setActiveMenu('deliverydate/items')
22
+ ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
23
+
24
+ return $this;
25
+ }
26
+
27
+ public function indexAction() {
28
+ $this->_initAction()
29
+ ->renderLayout();
30
+ }
31
+
32
+ public function editAction() {
33
+ $id = $this->getRequest()->getParam('id');
34
+ $model = Mage::getModel('deliverydate/deliverydate')->load($id);
35
+
36
+ if ($model->getId() || $id == 0) {
37
+ $data = Mage::getSingleton('adminhtml/session')->getFormData(true);
38
+ if (!empty($data)) {
39
+ $model->setData($data);
40
+ }
41
+
42
+ Mage::register('deliverydate_data', $model);
43
+
44
+ $this->loadLayout();
45
+ $this->_setActiveMenu('deliverydate/items');
46
+
47
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
48
+ $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));
49
+
50
+ $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
51
+
52
+ $this->_addContent($this->getLayout()->createBlock('deliverydate/adminhtml_deliverydate_edit'))
53
+ ->_addLeft($this->getLayout()->createBlock('deliverydate/adminhtml_deliverydate_edit_tabs'));
54
+
55
+ $this->renderLayout();
56
+ } else {
57
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('deliverydate')->__('Item does not exist'));
58
+ $this->_redirect('*/*/');
59
+ }
60
+ }
61
+
62
+ public function newAction() {
63
+ $this->_forward('edit');
64
+ }
65
+
66
+ public function saveAction() {
67
+ if ($data = $this->getRequest()->getPost()) {
68
+
69
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '') {
70
+ try {
71
+ /* Starting upload */
72
+ $uploader = new Varien_File_Uploader('filename');
73
+
74
+ // Any extention would work
75
+ $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
76
+ $uploader->setAllowRenameFiles(false);
77
+
78
+ // Set the file upload mode
79
+ // false -> get the file directly in the specified folder
80
+ // true -> get the file in the product like folders
81
+ // (file.jpg will go in something like /media/f/i/file.jpg)
82
+ $uploader->setFilesDispersion(false);
83
+
84
+ // We set media as the upload dir
85
+ $path = Mage::getBaseDir('media') . DS ;
86
+ $uploader->save($path, $_FILES['filename']['name'] );
87
+
88
+ } catch (Exception $e) {
89
+
90
+ }
91
+
92
+ //this way the name is saved in DB
93
+ $data['filename'] = $_FILES['filename']['name'];
94
+ }
95
+
96
+
97
+ $model = Mage::getModel('deliverydate/deliverydate');
98
+ $model->setData($data)
99
+ ->setId($this->getRequest()->getParam('id'));
100
+
101
+ try {
102
+ if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
103
+ $model->setCreatedTime(now())
104
+ ->setUpdateTime(now());
105
+ } else {
106
+ $model->setUpdateTime(now());
107
+ }
108
+
109
+ $model->save();
110
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('deliverydate')->__('Item was successfully saved'));
111
+ Mage::getSingleton('adminhtml/session')->setFormData(false);
112
+
113
+ if ($this->getRequest()->getParam('back')) {
114
+ $this->_redirect('*/*/edit', array('id' => $model->getId()));
115
+ return;
116
+ }
117
+ $this->_redirect('*/*/');
118
+ return;
119
+ } catch (Exception $e) {
120
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
121
+ Mage::getSingleton('adminhtml/session')->setFormData($data);
122
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
123
+ return;
124
+ }
125
+ }
126
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('deliverydate')->__('Unable to find item to save'));
127
+ $this->_redirect('*/*/');
128
+ }
129
+
130
+ public function deleteAction() {
131
+ if( $this->getRequest()->getParam('id') > 0 ) {
132
+ try {
133
+ $model = Mage::getModel('deliverydate/deliverydate');
134
+
135
+ $model->setId($this->getRequest()->getParam('id'))
136
+ ->delete();
137
+
138
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
139
+ $this->_redirect('*/*/');
140
+ } catch (Exception $e) {
141
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
142
+ $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
143
+ }
144
+ }
145
+ $this->_redirect('*/*/');
146
+ }
147
+
148
+ public function massDeleteAction() {
149
+ $deliverydateIds = $this->getRequest()->getParam('deliverydate');
150
+ if(!is_array($deliverydateIds)) {
151
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));
152
+ } else {
153
+ try {
154
+ foreach ($deliverydateIds as $deliverydateId) {
155
+ $deliverydate = Mage::getModel('deliverydate/deliverydate')->load($deliverydateId);
156
+ $deliverydate->delete();
157
+ }
158
+ Mage::getSingleton('adminhtml/session')->addSuccess(
159
+ Mage::helper('adminhtml')->__(
160
+ 'Total of %d record(s) were successfully deleted', count($deliverydateIds)
161
+ )
162
+ );
163
+ } catch (Exception $e) {
164
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
165
+ }
166
+ }
167
+ $this->_redirect('*/*/index');
168
+ }
169
+
170
+ public function massStatusAction()
171
+ {
172
+ $deliverydateIds = $this->getRequest()->getParam('deliverydate');
173
+ if(!is_array($deliverydateIds)) {
174
+ Mage::getSingleton('adminhtml/session')->addError($this->__('Please select item(s)'));
175
+ } else {
176
+ try {
177
+ foreach ($deliverydateIds as $deliverydateId) {
178
+ $deliverydate = Mage::getSingleton('deliverydate/deliverydate')
179
+ ->load($deliverydateId)
180
+ ->setStatus($this->getRequest()->getParam('status'))
181
+ ->setIsMassupdate(true)
182
+ ->save();
183
+ }
184
+ $this->_getSession()->addSuccess(
185
+ $this->__('Total of %d record(s) were successfully updated', count($deliverydateIds))
186
+ );
187
+ } catch (Exception $e) {
188
+ $this->_getSession()->addError($e->getMessage());
189
+ }
190
+ }
191
+ $this->_redirect('*/*/index');
192
+ }
193
+
194
+ public function exportCsvAction()
195
+ {
196
+ $fileName = 'deliverydate.csv';
197
+ $content = $this->getLayout()->createBlock('deliverydate/adminhtml_deliverydate_grid')
198
+ ->getCsv();
199
+
200
+ $this->_sendUploadResponse($fileName, $content);
201
+ }
202
+
203
+ public function exportXmlAction()
204
+ {
205
+ $fileName = 'deliverydate.xml';
206
+ $content = $this->getLayout()->createBlock('deliverydate/adminhtml_deliverydate_grid')
207
+ ->getXml();
208
+
209
+ $this->_sendUploadResponse($fileName, $content);
210
+ }
211
+
212
+ protected function _sendUploadResponse($fileName, $content, $contentType='application/octet-stream')
213
+ {
214
+ $response = $this->getResponse();
215
+ $response->setHeader('HTTP/1.1 200 OK','');
216
+ $response->setHeader('Pragma', 'public', true);
217
+ $response->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
218
+ $response->setHeader('Content-Disposition', 'attachment; filename='.$fileName);
219
+ $response->setHeader('Last-Modified', date('r'));
220
+ $response->setHeader('Accept-Ranges', 'bytes');
221
+ $response->setHeader('Content-Length', strlen($content));
222
+ $response->setHeader('Content-type', $contentType);
223
+ $response->setBody($content);
224
+ $response->sendResponse();
225
+ die;
226
+ }
227
+ }
app/code/local/Softprodigy/Deliverydate/controllers/IndexController.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ class Softprodigy_Deliverydate_IndexController extends Mage_Core_Controller_Front_Action
17
+ {
18
+ public function indexAction()
19
+ {
20
+ $this->loadLayout();
21
+ $this->renderLayout();
22
+ }
23
+ }
app/code/local/Softprodigy/Deliverydate/etc/config.xml ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category Softprodigy
12
+ * @package Softprodigy_Deliverydate
13
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ -->
17
+ <config>
18
+ <modules>
19
+ <Softprodigy_Deliverydate>
20
+ <version>1.0.0</version>
21
+ </Softprodigy_Deliverydate>
22
+ </modules>
23
+ <frontend>
24
+ <routers>
25
+ <deliverydate>
26
+ <use>standard</use>
27
+ <args>
28
+ <module>Softprodigy_Deliverydate</module>
29
+ <frontName>deliverydate</frontName>
30
+ </args>
31
+ </deliverydate>
32
+ </routers>
33
+ <layout>
34
+ <updates>
35
+ <deliverydate>
36
+ <file>deliverydate.xml</file>
37
+ </deliverydate>
38
+ </updates>
39
+ </layout>
40
+
41
+ <events>
42
+ <checkout_controller_onepage_save_shipping_method>
43
+ <observers>
44
+ <deliverydate_observer>
45
+ <type>singleton</type>
46
+ <class>deliverydate/observer</class>
47
+ <method>checkout_controller_onepage_save_shipping_method</method>
48
+ </deliverydate_observer>
49
+ </observers>
50
+ </checkout_controller_onepage_save_shipping_method>
51
+ <sales_order_save_after>
52
+ <observers>
53
+ <order_set_shippingarrivaldate>
54
+ <type>model</type>
55
+ <class>Softprodigy_Deliverydate_Helper_Data</class>
56
+ <method>saveShippingArrivalDate</method>
57
+ </order_set_shippingarrivaldate>
58
+ </observers>
59
+ </sales_order_save_after>
60
+ </events>
61
+ </frontend>
62
+ <admin>
63
+ <routers>
64
+ <deliverydate>
65
+ <use>admin</use>
66
+ <args>
67
+ <module>Softprodigy_Deliverydate</module>
68
+ <frontName>deliverydate</frontName>
69
+ </args>
70
+ </deliverydate>
71
+ </routers>
72
+ </admin>
73
+ <adminhtml>
74
+ <acl>
75
+ <resources>
76
+ <all>
77
+ <title>Allow Everything</title>
78
+ </all>
79
+ <admin>
80
+ <children>
81
+ <Softprodigy_Deliverydate>
82
+ <title>Enhanced Deliverydate Module</title>
83
+ <sort_order>10</sort_order>
84
+ </Softprodigy_Deliverydate>
85
+ <system>
86
+ <children>
87
+ <config>
88
+ <children>
89
+ <deliverydate>
90
+ <title>Enhanced Delivery Date</title>
91
+ </deliverydate>
92
+ </children>
93
+ </config>
94
+ </children>
95
+ </system>
96
+ </children>
97
+ </admin>
98
+ </resources>
99
+ </acl>
100
+ <layout>
101
+ <updates>
102
+ <deliverydate>
103
+ <file>deliverydate.xml</file>
104
+ </deliverydate>
105
+ </updates>
106
+ </layout>
107
+ <events>
108
+ <sales_order_save_after>
109
+ <observers>
110
+ <set_order_shippingarrivaldate>
111
+ <type>model</type>
112
+ <class>Softprodigy_Deliverydate_Helper_Data</class>
113
+ <method>saveShippingArrivalDateAdmin</method>
114
+ </set_order_shippingarrivaldate>
115
+ </observers>
116
+ </sales_order_save_after>
117
+
118
+ </events>
119
+ </adminhtml>
120
+ <global>
121
+ <models>
122
+ <deliverydate>
123
+ <class>Softprodigy_Deliverydate_Model</class>
124
+ <resourceModel>deliverydate_mysql4</resourceModel>
125
+ </deliverydate>
126
+ <deliverydate_mysql4>
127
+ <class>Softprodigy_Deliverydate_Model_Mysql4</class>
128
+ <entities>
129
+ <deliverydate>
130
+ <table>deliverydate</table>
131
+ </deliverydate>
132
+ </entities>
133
+ </deliverydate_mysql4>
134
+ </models>
135
+ <resources>
136
+ <deliverydate_setup>
137
+ <setup>
138
+ <module>Softprodigy_Deliverydate</module>
139
+ </setup>
140
+ <connection>
141
+ <use>core_setup</use>
142
+ </connection>
143
+ </deliverydate_setup>
144
+ <deliverydate_write>
145
+ <connection>
146
+ <use>core_write</use>
147
+ </connection>
148
+ </deliverydate_write>
149
+ <deliverydate_read>
150
+ <connection>
151
+ <use>core_read</use>
152
+ </connection>
153
+ </deliverydate_read>
154
+ </resources>
155
+ <blocks>
156
+ <deliverydate>
157
+ <class>Softprodigy_Deliverydate_Block</class>
158
+ </deliverydate>
159
+ <sales>
160
+ <rewrite>
161
+ <order_info>Softprodigy_Deliverydate_Block_Order_Info</order_info>
162
+ </rewrite>
163
+ </sales>
164
+ </blocks>
165
+ <helpers>
166
+ <deliverydate>
167
+ <class>Softprodigy_Deliverydate_Helper</class>
168
+ </deliverydate>
169
+ </helpers>
170
+ <default>
171
+ <deliverydate>
172
+ <deliverydate_general>
173
+ <enabled>0</enabled>
174
+ <on_which_page>1</on_which_page>
175
+ <deliverydate_format>d/M/Y</deliverydate_format>
176
+ <deliverytime_format>g:i a</deliverytime_format>
177
+ <deliverydate_dayoff></deliverydate_dayoff>
178
+ </deliverydate_general>
179
+ </deliverydate>
180
+ </default>
181
+ </global>
182
+ </config>
app/code/local/Softprodigy/Deliverydate/etc/system.xml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category Softprodigy
12
+ * @package Softprodigy_Deliverydate
13
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ -->
17
+ <config>
18
+ <tabs>
19
+ <softprodigy translate="label" module="deliverydate">
20
+ <label>SoftProdigy</label>
21
+ <sort_order>400</sort_order>
22
+ </softprodigy>
23
+ </tabs>
24
+ <sections>
25
+ <deliverydate translate="label" module="deliverydate">
26
+ <class>separator-top</class>
27
+ <label>Enhanced Delivery Date</label>
28
+ <tab>softprodigy</tab>
29
+ <sort_order>130</sort_order>
30
+ <show_in_default>1</show_in_default>
31
+ <show_in_website>1</show_in_website>
32
+ <show_in_store>1</show_in_store>
33
+ <groups>
34
+ <deliverydate_general translate="label">
35
+ <label>General</label>
36
+ <frontend_type>text</frontend_type>
37
+ <sort_order>10</sort_order>
38
+ <show_in_default>1</show_in_default>
39
+ <show_in_website>1</show_in_website>
40
+ <show_in_store>1</show_in_store>
41
+ <fields>
42
+ <enabled translate="label">
43
+ <label>Enabled</label>
44
+ <frontend_type>select</frontend_type>
45
+ <source_model>adminhtml/system_config_source_yesno</source_model>
46
+ <sort_order>1</sort_order>
47
+ <show_in_default>1</show_in_default>
48
+ <show_in_website>1</show_in_website>
49
+ <show_in_store>1</show_in_store>
50
+ <comment>Select Yes to enable this feature.</comment>
51
+ </enabled>
52
+ <on_which_page translate="label">
53
+ <label>Show on?</label>
54
+ <frontend_type>select</frontend_type>
55
+ <source_model>Softprodigy_Deliverydate_Model_Config_Option</source_model>
56
+ <sort_order>2</sort_order>
57
+ <show_in_default>1</show_in_default>
58
+ <show_in_website>1</show_in_website>
59
+ <show_in_store>1</show_in_store>
60
+ <comment>Choose at which step delivery date should be captured.</comment>
61
+ </on_which_page>
62
+ <deliverydate_html translate="label">
63
+ <label>Design HTML</label>
64
+ <frontend_type>textarea</frontend_type>
65
+ <sort_order>3</sort_order>
66
+ <show_in_default>1</show_in_default>
67
+ <show_in_website>1</show_in_website>
68
+ <show_in_store>1</show_in_store>
69
+ <comment></comment>
70
+ </deliverydate_html>
71
+ <deliverydate_format>
72
+ <label>Date Format</label>
73
+ <frontend_type>select</frontend_type>
74
+ <source_model>Softprodigy_Deliverydate_Model_Config_Dateformat</source_model>
75
+ <sort_order>4</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ <comment>Choose date format in which date will be displayed in frontend and admin panel.</comment>
80
+ </deliverydate_format>
81
+ <deliverytime_format>
82
+ <label>Time Format</label>
83
+ <frontend_type>select</frontend_type>
84
+ <source_model>Softprodigy_Deliverydate_Model_Config_Timeformat</source_model>
85
+ <sort_order>4</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ <comment>Choose time format in which time will be displayed in frontend and admin panel.</comment>
90
+ </deliverytime_format>
91
+ <deliverydate_dayoff>
92
+ <label>Day Off</label>
93
+ <frontend_type>multiselect</frontend_type>
94
+ <source_model>Softprodigy_Deliverydate_Model_Config_Dayoff</source_model>
95
+ <sort_order>5</sort_order>
96
+ <show_in_default>1</show_in_default>
97
+ <show_in_website>1</show_in_website>
98
+ <show_in_store>1</show_in_store>
99
+ <comment>Choose days on which shipping will not be available.</comment>
100
+ </deliverydate_dayoff>
101
+ </fields>
102
+ </deliverydate_general>
103
+ </groups>
104
+ </deliverydate>
105
+ </sections>
106
+ </config>
app/code/local/Softprodigy/Deliverydate/sql/deliverydate_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ $installer = $this;
17
+
18
+ $installer->startSetup();
19
+
20
+ $installer->run("
21
+
22
+ -- DROP TABLE IF EXISTS {$this->getTable('deliverydate')};
23
+ CREATE TABLE {$this->getTable('deliverydate')} (
24
+ `deliverydate_id` int(11) unsigned NOT NULL auto_increment,
25
+ `title` varchar(255) NOT NULL default '',
26
+ `filename` varchar(255) NOT NULL default '',
27
+ `content` text NOT NULL default '',
28
+ `status` smallint(6) NOT NULL default '0',
29
+ `created_time` datetime NULL,
30
+ `update_time` datetime NULL,
31
+ PRIMARY KEY (`deliverydate_id`)
32
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
33
+
34
+ ");
35
+
36
+ $this->_conn->addColumn($this->getTable('sales_flat_quote'), 'shipping_arrival_date', 'datetime');
37
+ $this->_conn->addColumn($this->getTable('sales_flat_quote'), 'shipping_arrival_comments', 'text');
38
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'shipping_arrival_date', 'datetime');
39
+ $this->_conn->addColumn($this->getTable('sales_flat_order'), 'shipping_arrival_comments', 'text');
40
+
41
+ $installer->endSetup();
app/design/adminhtml/default/default/layout/deliverydate.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category Softprodigy
12
+ * @package Softprodigy_Deliverydate
13
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ -->
17
+ <layout version="0.1.0">
18
+ <deliverydate_adminhtml_deliverydate_index>
19
+ <reference name="content">
20
+ <block type="deliverydate/adminhtml_deliverydate" name="deliverydate" />
21
+ </reference>
22
+ <reference name="head">
23
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action>
24
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
25
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
26
+ <block type="core/html_calendar" name="head.calendar" as="calendar" template="deliverydate/js/calendar.phtml">
27
+ </block>
28
+ </reference>
29
+ </deliverydate_adminhtml_deliverydate_index>
30
+ <adminhtml_sales_order_view>
31
+ <reference name="order_tab_info">
32
+ <action method="setTemplate" ifconfig="deliverydate/deliverydate_general/enabled">
33
+ <template>deliverydate/info.phtml</template>
34
+ </action>
35
+ </reference>
36
+ </adminhtml_sales_order_view>
37
+
38
+ </layout>
app/design/adminhtml/default/default/template/deliverydate/date.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+
16
+ if (Mage::getStoreConfig('deliverydate/deliverydate_general/enabled')==1){
17
+ ?>
18
+ <div class="field">
19
+ <div class="input-box">
20
+ <label for="page_date-end"><?php echo Mage::helper('sales')->__('Delivery Date:') ?></label>
21
+ <input name="shipping_arrival_date_display" id="shipping_arrival_date_display" value="" type="text">
22
+ <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>
23
+ </div>
24
+ <label for="shipping_arrival_comments">Delivery Comments:</label><br/>
25
+ <textarea cols="65" rows="8" name="shipping_arrival_comments" id="shipping_arrival_comments"></textarea>
26
+ </div>
27
+ <script type="text/javascript">
28
+ //<![CDATA[
29
+ Calendar.setup({
30
+ inputField : 'shipping_arrival_date_display',
31
+ ifFormat : '%Y-%m-%e %H:%M:%S',
32
+ button : 'shipping_arrival_date_trig',
33
+ showsTime : true,
34
+ align : 'Bl',
35
+ singleClick : true
36
+ });
37
+ Event.observe($('link_reset'),'click',function(){
38
+ $('shipping_arrival_date_display').setValue('');
39
+ });
40
+ //]]>
41
+ </script>
42
+ <?php
43
+ }
44
+ ?>
app/design/adminhtml/default/default/template/deliverydate/info.phtml ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <?php /** @var $this Mage_Adminhtml_Block_Sales_Order_View_Tab_Info */ ?>
17
+ <?php $_order = $this->getOrder() ?>
18
+ <div>
19
+ <div id="order-messages">
20
+ <?php echo $this->getChildHtml('order_messages') ?>
21
+ </div>
22
+ <?php echo $this->getChildHtml('order_info') ?>
23
+ <input type="hidden" name="order_id" value="<?php echo $_order->getId() ?>"/>
24
+ <?php if ($_order->getIsVirtual()): ?>
25
+ <div class="box-right">
26
+ <?php else: ?>
27
+ <div class="box-left">
28
+ <?php endif; ?>
29
+ <!--Payment Method-->
30
+ <div class="entry-edit">
31
+ <div class="entry-edit-head">
32
+ <h4 class="icon-head head-payment-method"><?php echo Mage::helper('sales')->__('Payment Information') ?></h4>
33
+ </div>
34
+ <fieldset>
35
+ <?php echo $this->getPaymentHtml() ?>
36
+ <div><?php echo Mage::helper('sales')->__('Order was placed using %s', $_order->getOrderCurrencyCode()) ?></div>
37
+ </fieldset>
38
+ </div>
39
+ </div>
40
+ <?php if (!$_order->getIsVirtual()): ?>
41
+ <div class="box-right">
42
+ <!--Shipping Method-->
43
+ <div class="entry-edit">
44
+ <div class="entry-edit-head">
45
+ <h4 class="icon-head head-shipping-method"><?php echo Mage::helper('sales')->__('Shipping &amp; Handling Information') ?></h4>
46
+ </div>
47
+ <fieldset>
48
+ <?php if ($_order->getTracksCollection()->count()) : ?>
49
+ <a href="#" id="linkId" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','width=800,height=600,resizable=yes,scrollbars=yes')" title="<?php echo $this->__('Track Order') ?>"><?php echo $this->__('Track Order') ?></a>
50
+ <br/>
51
+ <?php endif; ?>
52
+ <?php if ($_order->getShippingDescription()): ?>
53
+ <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>
54
+
55
+ <?php if ($this->helper('tax')->displayShippingPriceIncludingTax()): ?>
56
+ <?php $_excl = $this->displayShippingPriceInclTax($_order); ?>
57
+ <?php else: ?>
58
+ <?php $_excl = $this->displayPriceAttribute('shipping_amount', false, ' '); ?>
59
+ <?php endif; ?>
60
+ <?php $_incl = $this->displayShippingPriceInclTax($_order); ?>
61
+
62
+ <?php echo $_excl; ?>
63
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
64
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
65
+ <?php endif; ?>
66
+ <?php else: ?>
67
+ <?php echo $this->helper('sales')->__('No shipping information available'); ?>
68
+ <?php endif; ?>
69
+ </fieldset>
70
+ </div>
71
+ </div>
72
+ <?php endif; ?>
73
+ <div class="clear"></div>
74
+ <div class="entry-edit">
75
+ <div class="entry-edit-head">
76
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Delivery Date Information') ?></h4>
77
+ </div>
78
+ </div>
79
+ <div class="grid np">
80
+ <fieldset>
81
+ <?php
82
+ $date_format = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_format');
83
+ $time_format = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverytime_format');
84
+ if ($date_format=='')
85
+ $date_format='d/M/Y';
86
+ if($time_format=='')
87
+ $date_format.=" ,g:i a";
88
+ else
89
+ $date_format.=" ".$time_format;
90
+ if ($_order->getShippingArrivalDate()!='')
91
+ echo "<strong>Shipping Arrival Date :- </strong>".$currentDate = date ($date_format,strtotime($_order->getShippingArrivalDate()));
92
+ else
93
+ echo "<strong>Shipping Arrival Date :- </strong> N/A";
94
+ if ($_order->getShippingArrivalComments()!='')
95
+ echo "<br/>".$_order->getShippingArrivalComments();
96
+ ?>
97
+ </fieldset>
98
+ </div>
99
+ <?php echo $this->getGiftOptionsHtml() ?>
100
+ <div class="clear"></div>
101
+ <div class="entry-edit">
102
+ <div class="entry-edit-head">
103
+ <h4 class="icon-head head-products"><?php echo Mage::helper('sales')->__('Items Ordered') ?></h4>
104
+ </div>
105
+ </div>
106
+ <?php echo $this->getItemsHtml() ?>
107
+ <div class="clear"></div>
108
+
109
+ <div class="box-left">
110
+ <div class="entry-edit">
111
+ <div class="entry-edit-head">
112
+ <h4><?php echo Mage::helper('sales')->__('Comments History') ?></h4>
113
+ </div>
114
+ <fieldset><?php echo $this->getChildHtml('order_history') ?></fieldset>
115
+ </div>
116
+ </div>
117
+ <div class="box-right entry-edit">
118
+ <div class="entry-edit-head"><h4><?php echo Mage::helper('sales')->__('Order Totals') ?></h4></div>
119
+ <div class="order-totals"><?php echo $this->getChildHtml('order_totals') ?></div>
120
+ </div>
121
+ <div class="clear"></div>
122
+ </div>
123
+
124
+ <?php echo $this->getChildHtml('popup_window');?>
125
+ <script type="text/javascript">
126
+ //<![CDATA[
127
+ /**
128
+ * Retrieve gift options tooltip content
129
+ */
130
+ function getGiftOptionsTooltipContent(itemId) {
131
+ var contentLines = [];
132
+ var headerLine = null;
133
+ var contentLine = null;
134
+
135
+ $$('#gift_options_data_' + itemId + ' .gift-options-tooltip-content').each(function (element) {
136
+ if (element.down(0)) {
137
+ headerLine = element.down(0).innerHTML;
138
+ contentLine = element.down(0).next().innerHTML;
139
+ if (contentLine.length > 30) {
140
+ contentLine = contentLine.slice(0,30) + '...';
141
+ }
142
+ contentLines.push(headerLine + ' ' + contentLine);
143
+ }
144
+ });
145
+ return contentLines.join('<br/>');
146
+ }
147
+ giftOptionsTooltip.setTooltipContentLoaderFunction(getGiftOptionsTooltipContent);
148
+ //]]>
149
+ </script>
app/design/adminhtml/default/default/template/deliverydate/js/calendar.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+
17
+ <?php
18
+ /**
19
+ * Calendar localization script. Should be put into page header.
20
+ *
21
+ * @see Mage_Core_Block_Html_Calendar
22
+ */
23
+ ?>
24
+
25
+ <script type="text/javascript">
26
+ //<![CDATA[
27
+ enUS = <?php echo $enUS?>; // en_US locale reference
28
+ Calendar._DN = <?php echo $days['wide']?>; // full day names
29
+ Calendar._SDN = <?php echo $days['abbreviated']?>; // short day names
30
+ Calendar._FD = <?php echo $firstDay?>; // First day of the week. "0" means display Sunday first, "1" means display Monday first, etc.
31
+ Calendar._MN = <?php echo $months['wide']?>; // full month names
32
+ Calendar._SMN = <?php echo $months['abbreviated']?>; // short month names
33
+ Calendar._am = <?php echo $am ?>; // am/pm
34
+ Calendar._pm = <?php echo $pm ?>;
35
+
36
+ // tooltips
37
+ Calendar._TT = {};
38
+ Calendar._TT["INFO"] = "<?php echo $this->__('About the calendar');?>";
39
+
40
+ Calendar._TT["ABOUT"] =
41
+ "<?php echo $this->__('DHTML Date/Time Selector')?>\n" +
42
+ "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
43
+ "<?php echo $this->__('For latest version visit: %s', 'http://www.dynarch.com/projects/calendar/')?>\n" +
44
+ "<?php echo $this->__('Distributed under GNU LGPL. See %s for details.', 'http://gnu.org/licenses/lgpl.html')?>" +
45
+ "\n\n" +
46
+ "<?php echo $this->__('Date selection:')?>\n" +
47
+ "<?php echo $this->__('- Use the %s, %s buttons to select year', '\\xab', '\xbb')?>\n" +
48
+ "<?php echo $this->__('- Use the %s buttons to select month', '" + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "')?>\n" +
49
+ "<?php echo $this->__('- Hold mouse button on any of the above buttons for faster selection.')?>";
50
+ Calendar._TT["ABOUT_TIME"] = "\n\n" +
51
+ "<?php echo $this->__('Time selection:')?>\n" +
52
+ "<?php echo $this->__('- Click on any of the time parts to increase it')?>\n" +
53
+ "<?php echo $this->__('- or Shift-click to decrease it')?>\n" +
54
+ "<?php echo $this->__('- or click and drag for faster selection.')?>";
55
+
56
+ Calendar._TT["PREV_YEAR"] = "<?php echo $this->__('Prev. year (hold for menu)');?>";
57
+ Calendar._TT["PREV_MONTH"] = "<?php echo $this->__('Prev. month (hold for menu)');?>";
58
+ Calendar._TT["GO_TODAY"] = "<?php echo $this->__('Go Today');?>";
59
+ Calendar._TT["NEXT_MONTH"] = "<?php echo $this->__('Next month (hold for menu)');?>";
60
+ Calendar._TT["NEXT_YEAR"] = "<?php echo $this->__('Next year (hold for menu)');?>";
61
+ Calendar._TT["SEL_DATE"] = "<?php echo $this->__('Select date');?>";
62
+ Calendar._TT["DRAG_TO_MOVE"] = "<?php echo $this->__('Drag to move');?>";
63
+ Calendar._TT["PART_TODAY"] = ' (' + <?php echo $today ?> + ')';
64
+
65
+ // the following is to inform that "%s" is to be the first day of week
66
+ Calendar._TT["DAY_FIRST"] = "<?php echo $this->__('Display %s first', '%s');?>";
67
+
68
+ // This may be locale-dependent. It specifies the week-end days, as an array
69
+ // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
70
+ // means Monday, etc.
71
+ Calendar._TT["WEEKEND"] = <?php echo $weekendDays?>;
72
+
73
+ Calendar._TT["CLOSE"] = "<?php echo $this->__('Close');?>";
74
+ Calendar._TT["TODAY"] = <?php echo $today ?>;
75
+ Calendar._TT["TIME_PART"] = "<?php echo $this->__('(Shift-)Click or drag to change value');?>";
76
+
77
+ // date formats
78
+ Calendar._TT["DEF_DATE_FORMAT"] = <?php echo $defaultFormat?>;
79
+ Calendar._TT["TT_DATE_FORMAT"] = <?php echo $toolTipFormat?>;
80
+
81
+ Calendar._TT["WK"] = <?php echo $week ?>;
82
+ Calendar._TT["TIME"] = "<?php echo $this->__('Time:');?>";
83
+ //]]>
84
+ </script>
app/design/frontend/default/default/layout/deliverydate.xml ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * NOTICE OF LICENSE
5
+ *
6
+ * This source file is subject to the Open Software License (OSL 3.0)
7
+ * that is bundled with this package in the file LICENSE.txt.
8
+ * It is also available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ *
11
+ * @category Softprodigy
12
+ * @package Softprodigy_Deliverydate
13
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
14
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
15
+ */
16
+ -->
17
+ <layout version="0.1.0">
18
+ <default>
19
+ </default>
20
+ <deliverydate_index_index>
21
+ <reference name="content">
22
+ <block type="deliverydate/deliverydate" name="deliverydate" template="deliverydate/deliverydate.phtml" />
23
+ </reference>
24
+ </deliverydate_index_index>
25
+
26
+ <checkout_onepage_index>
27
+ <reference name="head">
28
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params/><!--<if/><condition>can_load_calendar_js</condition>--></action>
29
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
30
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name><!--<params/><if/><condition>can_load_calendar_js</condition>--></action>
31
+ </reference>
32
+ </checkout_onepage_index>
33
+
34
+
35
+ <checkout_onepage_shippingmethod>
36
+ <reference name="root">
37
+ <block type="core/html_calendar" name="head.calendar" as="calendar" output="toHtml" template="deliverydate/js/calendar.phtml"/>
38
+ <action method="setTemplate" ifconfig="deliverydate/deliverydate_general/enabled">
39
+ <template>deliverydate/shipping_method/available.phtml</template>
40
+ </action>
41
+ </reference>
42
+ </checkout_onepage_shippingmethod>
43
+
44
+ <checkout_onepage_review>
45
+ <reference name="root">
46
+ <action method="setTemplate" ifconfig="deliverydate/deliverydate_general/enabled"><template>deliverydate/review/info.phtml</template></action>
47
+ <block type="checkout/agreements" name="checkout.onepage.agreements" as="agreements">
48
+ <action method="setTemplate" ifconfig="deliverydate/deliverydate_general/enabled">
49
+ <template>deliverydate/agreements.phtml</template>
50
+ </action>
51
+ </block>
52
+ </reference>
53
+ </checkout_onepage_review>
54
+
55
+ <paypal_express_review>
56
+
57
+ <reference name="head">
58
+ <action method="addItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name><params></params></action>
59
+ <action method="addItem"><type>js</type><name>calendar/calendar.js</name></action>
60
+ <action method="addItem"><type>js</type><name>calendar/calendar-setup.js</name></action>
61
+ </reference>
62
+ <reference name="content">
63
+ <reference name="paypal.express.review.details.agreements">
64
+ <action method="setTemplate" ifconfig="deliverydate/deliverydate_general/enabled"><template>deliverydate/agreements.phtml</template></action>
65
+ </reference>
66
+ </reference>
67
+
68
+ </paypal_express_review>
69
+
70
+ <deliverydate_email_information>
71
+ <block type="deliverydate/email_info" name="deliverydate_email_info" template="deliverydate/email/info.phtml"/>
72
+ </deliverydate_email_information>
73
+ </layout>
app/design/frontend/default/default/template/deliverydate/agreements.phtml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <?php
17
+ /**
18
+ * @see Mage_Checkout_Block_Agreements
19
+ */
20
+ ?>
21
+ <style type="text/css">
22
+ .arrival-info ul{ border:none !important; padding:0 !important; margin:0 !important;}
23
+ .arrival-info li{ margin-bottom:10px; text-align:left; }
24
+ .arrival-info label{ font-weight:bold; color:#666666;}
25
+ </style>
26
+ <form action="" id="checkout-agreements" onsubmit="return false;">
27
+ <div class="buttons-set arrival-info">
28
+ <?php
29
+ if(Mage::getStoreConfig('deliverydate/deliverydate_general/enabled')){
30
+ if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==2){
31
+ echo $this->getLayout()->createBlock('core/html_calendar')->setTemplate('deliverydate/js/calendar.phtml')->toHtml() ;
32
+ echo $this->getLayout()->createBlock('deliverydate/deliverydate')->setTemplate('deliverydate/deliverydate.phtml')->toHtml();
33
+ }
34
+ }
35
+ ?>
36
+ </div>
37
+
38
+ <?php if (!$this->getAgreements()) return; ?>
39
+
40
+ <ol class="checkout-agreements">
41
+ <?php foreach ($this->getAgreements() as $_a): ?>
42
+ <li>
43
+ <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
44
+ <?php if ($_a->getIsHtml()):?>
45
+ <?php echo $_a->getContent() ?>
46
+ <?php else:?>
47
+ <?php echo nl2br($this->htmlEscape($_a->getContent())) ?>
48
+ <?php endif; ?>
49
+ </div>
50
+ <p class="agree">
51
+ <input type="checkbox" id="agreement-<?php echo $_a->getId()?>" name="agreement[<?php echo $_a->getId()?>]" value="1" title="<?php echo $this->htmlEscape($_a->getCheckboxText()) ?>" class="checkbox" /><label for="agreement-<?php echo $_a->getId()?>"><?php echo $_a->getIsHtml() ? $_a->getCheckboxText() : $this->htmlEscape($_a->getCheckboxText()) ?></label>
52
+ </p>
53
+ </li>
54
+ <?php endforeach ?>
55
+ </ol>
56
+ </form>
57
+ <script type="text/javascript">
58
+
59
+ </script>
app/design/frontend/default/default/template/deliverydate/deliverydate.phtml ADDED
@@ -0,0 +1,262 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <dd>
17
+ <ul style="border-top: 1px solid #D1D1D1; margin-top: 12px; padding-top: 10px;">
18
+ <li>
19
+ <label for="page_date-end">Delivery Date:</label>
20
+ <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>
21
+ <input name="shipping_arrival_date" id="shipping_arrival_date" value="" onChange="shippingArrivalDateOnChange(this); return false;" title="date" type="hidden">
22
+ </li>
23
+ <li>
24
+ <label for="shipping_arrival_comments">Delivery Comments:</label><br/>
25
+ <textarea cols="65" rows="8" name="shipping_arrival_comments" id="shipping_arrival_comments"></textarea></li>
26
+ <li> <i><?php echo Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_html'); ?></i>
27
+ </li>
28
+ </dd>
29
+ <?php
30
+ $dayoff = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_dayoff');
31
+ ?>
32
+
33
+ <script type="text/javascript">
34
+ Calendar.prototype._init = function (firstDayOfWeek, date) {
35
+ var today = new CalendarDateObject(),
36
+ TY = today.getFullYear(),
37
+ TM = today.getMonth(),
38
+ TD = today.getDate();
39
+ this.table.style.visibility = "hidden";
40
+ var year = date.getFullYear();
41
+ if (year < this.minYear) {
42
+ year = this.minYear;
43
+ date.setFullYear(year);
44
+ } else if (year > this.maxYear) {
45
+ year = this.maxYear;
46
+ date.setFullYear(year);
47
+ }
48
+ this.firstDayOfWeek = firstDayOfWeek;
49
+ this.date = new CalendarDateObject(date);
50
+ var month = date.getMonth();
51
+ var mday = date.getDate();
52
+ var no_days = date.getMonthDays();
53
+ /* Added By B.C. on date 18/02/2013 */
54
+ var check_flag = false;
55
+ /* END */
56
+
57
+ date.setDate(1);
58
+ var day1 = (date.getDay() - this.firstDayOfWeek) % 7;
59
+ if (day1 < 0)
60
+ day1 += 7;
61
+ date.setDate(-day1);
62
+ date.setDate(date.getDate() + 1);
63
+
64
+ var row = this.tbody.firstChild;
65
+ var MN = Calendar._SMN[month];
66
+ var ar_days = this.ar_days = new Array();
67
+ var weekend = Calendar._TT["WEEKEND"];
68
+ var dates = this.multiple ? (this.datesCells = {}) : null;
69
+ for (var i = 0; i < 6; ++i, row = row.nextSibling) {
70
+ var cell = row.firstChild;
71
+ if (this.weekNumbers) {
72
+ cell.className = "day wn";
73
+ cell.innerHTML = date.getWeekNumber();
74
+ cell = cell.nextSibling;
75
+ }
76
+ row.className = "daysrow";
77
+ var hasdays = false, iday, dpos = ar_days[i] = [];
78
+ for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) {
79
+ iday = date.getDate();
80
+ var wday = date.getDay();
81
+ cell.className = "day";
82
+ cell.pos = i << 4 | j;
83
+ dpos[j] = cell;
84
+ var current_month = (date.getMonth() == month);
85
+ if (!current_month) {
86
+ if (this.showsOtherMonths) {
87
+ cell.className += " othermonth";
88
+ cell.otherMonth = true;
89
+ } else {
90
+ cell.className = "emptycell";
91
+ cell.innerHTML = "&nbsp;";
92
+ cell.disabled = true;
93
+ continue;
94
+ }
95
+ } else {
96
+ cell.otherMonth = false;
97
+ hasdays = true;
98
+ }
99
+ cell.disabled = false;
100
+ cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday;
101
+ if (dates)
102
+ dates[date.print("%Y%m%d")] = cell;
103
+ if (this.getDateStatus) {
104
+ var status = this.getDateStatus(date, year, month, iday);
105
+ if (this.getDateToolTip) {
106
+ var toolTip = this.getDateToolTip(date, year, month, iday);
107
+ if (toolTip)
108
+ cell.title = toolTip;
109
+ }
110
+ if (status === true) {
111
+ cell.className += " disabled";
112
+ cell.disabled = true;
113
+ } else {
114
+ if (/disabled/i.test(status))
115
+ cell.disabled = true;
116
+ cell.className += " " + status;
117
+ }
118
+ }
119
+ if (!cell.disabled) {
120
+ cell.caldate = new CalendarDateObject(date);
121
+ cell.ttip = "_";
122
+ if (!this.multiple && current_month
123
+ && iday == mday && this.hiliteToday) {
124
+ cell.className += " selected";
125
+ this.currentDateEl = cell;
126
+ }
127
+ if (date.getFullYear() == TY &&
128
+ date.getMonth() == TM &&
129
+ iday == TD) {
130
+ cell.className += " today";
131
+ cell.ttip += Calendar._TT["PART_TODAY"];
132
+ }
133
+ if (weekend.indexOf(wday.toString()) != -1)
134
+ cell.className += cell.otherMonth ? " oweekend" : " weekend";
135
+ if (check_flag){
136
+ cell.className += " selected";
137
+ this.currentDateEl = cell;
138
+ check_flag=false;
139
+ }
140
+ }else{
141
+ /* Added By B.C. on date 18/02/2013 */
142
+ if (!this.multiple && current_month
143
+ && iday == mday && this.hiliteToday) {
144
+ check_flag=true;
145
+ }
146
+
147
+ /* END */
148
+ }
149
+ }
150
+ if (!(hasdays || this.showsOtherMonths))
151
+ row.className = "emptyrow";
152
+ }
153
+ this.title.innerHTML = Calendar._MN[month] + ", " + year;
154
+ this.onSetTime();
155
+ this.table.style.visibility = "visible";
156
+ this._initMultipleDates();
157
+ // PROFILE
158
+ // this.tooltips.innerHTML = "Generated in " + ((new CalendarDateObject()) - today) + " ms";
159
+ };
160
+
161
+ var dayoff = '<?php echo $dayoff; ?>';
162
+ var test_flag = false;
163
+ Calendar.setup({
164
+ inputField: "shipping_arrival_date",
165
+ ifFormat: "%Y-%mm-%ee %H:%M:%S",
166
+ showsTime: true,
167
+ button: "shipping_arrival_date_trig",
168
+ align: "Bl",
169
+ singleClick :true,
170
+ onSelect :function()
171
+ {
172
+ //var y = calendar.date.getFullYear();
173
+ currentTime1 = new Date();
174
+ var m = parseInt(currentTime1.getMonth())+parseInt(1);
175
+ var y=currentTime1.getFullYear();
176
+ var d = currentTime1.getDate();
177
+
178
+
179
+
180
+ currentTime = new Date(calendar.date.getTime());
181
+ var d1=currentTime.getDate();
182
+ var m1=parseInt(currentTime.getMonth())+parseInt(1);
183
+ var y1=currentTime.getFullYear();
184
+ var h1 = currentTime.getHours();
185
+ var min1= currentTime.getMinutes();
186
+
187
+
188
+ if (calendar.dateClicked)
189
+ {
190
+ if(d1 < d && m1==m && y1==y)
191
+ {
192
+ alert("You can not select previous date.")
193
+ document.getElementById('shipping_arrival_date_display').value="";
194
+ document.getElementById('shipping_arrival_date').value="";
195
+ calendar.hide();
196
+ }
197
+ else
198
+ {
199
+ document.getElementById('shipping_arrival_date_display').value=y1+"-"+m1+"-"+d1+" "+h1+":"+min1;
200
+ document.getElementById('shipping_arrival_date').value=y1+"-"+m1+"-"+d1+" "+h1+":"+min1;
201
+ calendar.hide();
202
+ }
203
+ }
204
+ else
205
+ {
206
+ calendar.show();
207
+ }
208
+ },
209
+ disableFunc : function(date)
210
+ {
211
+ var y = calendar.date.getFullYear();
212
+ var m = calendar.date.getMonth();
213
+ var d = calendar.date.getDate();
214
+
215
+ var day_off_array = dayoff.split(",") ;
216
+
217
+ currentTime = new Date();
218
+ var d1=currentTime.getDate();
219
+ var m1=currentTime.getMonth();
220
+ var y1=currentTime.getFullYear();
221
+ var counter = 1;
222
+ for (var i=0; i<day_off_array.length;i++){
223
+ if (day_off_array[i]>=0 && day_off_array[i]!=''){
224
+ if (date.getDay()==day_off_array[i]){
225
+ if (date.getDate()==currentTime.getDate()){
226
+ test_flag=true;
227
+ }
228
+ return true;
229
+ }
230
+ }
231
+ }
232
+
233
+ if(y < y1)
234
+ {
235
+ return true;
236
+ }
237
+ else if(m1 > m && y==y1)
238
+ {
239
+ return true;
240
+ }
241
+ }
242
+ });
243
+
244
+ function shippingArrivalDateOnChange(el)
245
+ {
246
+ var displayDate = $('shipping_arrival_date_display');
247
+ var date = $('shipping_arrival_date').getValue();
248
+ displayDate.setValue(date);
249
+ }
250
+
251
+ function resetArrivalDate()
252
+ {
253
+ //clear both fields
254
+
255
+ }
256
+ Form.Element.disable('shipping_arrival_date_display');
257
+ Event.observe($('link_reset'),'click',function(){
258
+ $('shipping_arrival_date').setValue('');
259
+ $('shipping_arrival_date_display').setValue('');
260
+ });
261
+ //]]>
262
+ </script>
app/design/frontend/default/default/template/deliverydate/email/info.phtml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <?php $_order = $this->getOrder() ?>
17
+ <?php
18
+ $date_format = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_format');
19
+ $time_format = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverytime_format');
20
+ if ($date_format=='')
21
+ $date_format='d/M/Y';
22
+ if($time_format=='')
23
+ $date_format.=" ,g:i a";
24
+ else
25
+ $date_format.=" ".$time_format;
26
+ if ($_order->getShippingArrivalDate()!='')
27
+ echo "<strong>Shipping Arrival Date :- </strong>".$currentDate = date ($date_format,strtotime($_order->getShippingArrivalDate()));
28
+ else
29
+ echo "<strong>Shipping Arrival Date :- </strong> N/A";
30
+ if ($_order->getShippingArrivalComments()!='')
31
+ echo "<br/>".$_order->getShippingArrivalComments();
32
+ ?>
app/design/frontend/default/default/template/deliverydate/js/calendar.phtml ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+
17
+ <?php
18
+ /**
19
+ * Calendar localization script. Should be put into page header.
20
+ *
21
+ * @see Mage_Core_Block_Html_Calendar
22
+ */
23
+ ?>
24
+
25
+ <script type="text/javascript">
26
+ //<![CDATA[
27
+ enUS = <?php echo $enUS?>; // en_US locale reference
28
+ Calendar._DN = <?php echo $days['wide']?>; // full day names
29
+ Calendar._SDN = <?php echo $days['abbreviated']?>; // short day names
30
+ Calendar._FD = <?php echo $firstDay?>; // First day of the week. "0" means display Sunday first, "1" means display Monday first, etc.
31
+ Calendar._MN = <?php echo $months['wide']?>; // full month names
32
+ Calendar._SMN = <?php echo $months['abbreviated']?>; // short month names
33
+ Calendar._am = <?php echo $am ?>; // am/pm
34
+ Calendar._pm = <?php echo $pm ?>;
35
+
36
+ // tooltips
37
+ Calendar._TT = {};
38
+ Calendar._TT["INFO"] = "<?php echo $this->__('About the calendar');?>";
39
+
40
+ Calendar._TT["ABOUT"] =
41
+ "<?php echo $this->__('DHTML Date/Time Selector')?>\n" +
42
+ "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
43
+ "<?php echo $this->__('For latest version visit: %s', 'http://www.dynarch.com/projects/calendar/')?>\n" +
44
+ "<?php echo $this->__('Distributed under GNU LGPL. See %s for details.', 'http://gnu.org/licenses/lgpl.html')?>" +
45
+ "\n\n" +
46
+ "<?php echo $this->__('Date selection:')?>\n" +
47
+ "<?php echo $this->__('- Use the %s, %s buttons to select year', '\\xab', '\xbb')?>\n" +
48
+ "<?php echo $this->__('- Use the %s buttons to select month', '" + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + "')?>\n" +
49
+ "<?php echo $this->__('- Hold mouse button on any of the above buttons for faster selection.')?>";
50
+ Calendar._TT["ABOUT_TIME"] = "\n\n" +
51
+ "<?php echo $this->__('Time selection:')?>\n" +
52
+ "<?php echo $this->__('- Click on any of the time parts to increase it')?>\n" +
53
+ "<?php echo $this->__('- or Shift-click to decrease it')?>\n" +
54
+ "<?php echo $this->__('- or click and drag for faster selection.')?>";
55
+
56
+ Calendar._TT["PREV_YEAR"] = "<?php echo $this->__('Prev. year (hold for menu)');?>";
57
+ Calendar._TT["PREV_MONTH"] = "<?php echo $this->__('Prev. month (hold for menu)');?>";
58
+ Calendar._TT["GO_TODAY"] = "<?php echo $this->__('Go Today');?>";
59
+ Calendar._TT["NEXT_MONTH"] = "<?php echo $this->__('Next month (hold for menu)');?>";
60
+ Calendar._TT["NEXT_YEAR"] = "<?php echo $this->__('Next year (hold for menu)');?>";
61
+ Calendar._TT["SEL_DATE"] = "<?php echo $this->__('Select date');?>";
62
+ Calendar._TT["DRAG_TO_MOVE"] = "<?php echo $this->__('Drag to move');?>";
63
+ Calendar._TT["PART_TODAY"] = ' (' + <?php echo $today ?> + ')';
64
+
65
+ // the following is to inform that "%s" is to be the first day of week
66
+ Calendar._TT["DAY_FIRST"] = "<?php echo $this->__('Display %s first', '%s');?>";
67
+
68
+ // This may be locale-dependent. It specifies the week-end days, as an array
69
+ // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
70
+ // means Monday, etc.
71
+ Calendar._TT["WEEKEND"] = <?php echo $weekendDays?>;
72
+
73
+ Calendar._TT["CLOSE"] = "<?php echo $this->__('Close');?>";
74
+ Calendar._TT["TODAY"] = <?php echo $today ?>;
75
+ Calendar._TT["TIME_PART"] = "<?php echo $this->__('(Shift-)Click or drag to change value');?>";
76
+
77
+ // date formats
78
+ Calendar._TT["DEF_DATE_FORMAT"] = <?php echo $defaultFormat?>;
79
+ Calendar._TT["TT_DATE_FORMAT"] = <?php echo $toolTipFormat?>;
80
+
81
+ Calendar._TT["WK"] = <?php echo $week ?>;
82
+ Calendar._TT["TIME"] = "<?php echo $this->__('Time:');?>";
83
+ //]]>
84
+ </script>
app/design/frontend/default/default/template/deliverydate/order/info.phtml ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <?php /** @var $this Mage_Sales_Block_Order_Info */ ?>
17
+ <?php $_order = $this->getOrder() ?>
18
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
19
+ <div class="page-title title-buttons">
20
+ <h1><?php echo $this->__('Order #%s - %s', $_order->getRealOrderId(), $_order->getStatusLabel()) ?></h1>
21
+ <?php echo $this->getChildHtml('buttons') ?>
22
+ </div>
23
+ <?php echo $this->getStatusHistoryRssUrl($_order) ?>
24
+ <dl class="order-info">
25
+ <dt><?php echo $this->__('About This Order:') ?></dt>
26
+ <dd>
27
+ <?php $_links = $this->getLinks(); ?>
28
+ <ul id="order-info-tabs">
29
+ <?php foreach ($_links as $_link): ?>
30
+ <?php if($_link->getUrl()): ?>
31
+ <li><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?></a></li>
32
+ <?php else: ?>
33
+ <li class="current"><?php echo $_link->getLabel() ?></li>
34
+ <?php endif; ?>
35
+ <?php endforeach; ?>
36
+ </ul>
37
+ <script type="text/javascript">decorateGeneric($('order-info-tabs').select('LI'),['first','last']);</script>
38
+ </dd>
39
+ </dl>
40
+ <p class="order-date"><?php echo $this->__('Order Date: %s', $this->formatDate($_order->getCreatedAtStoreDate(), 'long')) ?></p>
41
+ <?php if (!$_order->getIsVirtual()): ?>
42
+ <div class="col2-set order-info-box">
43
+ <div class="col-1">
44
+ <div class="box">
45
+ <div class="box-title">
46
+ <h2><?php echo $this->__('Shipping Address') ?></h2>
47
+ </div>
48
+ <div class="box-content">
49
+ <address><?php echo $_order->getShippingAddress()->format('html') ?></address>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ <div class="col-2">
54
+ <div class="box">
55
+ <div class="box-title">
56
+ <h2><?php echo $this->__('Shipping Method') ?></h2>
57
+ </div>
58
+ <div class="box-content">
59
+ <?php
60
+ if ($_order->getShippingDescription()): ?>
61
+ <?php echo $this->escapeHtml($_order->getShippingDescription()); ?>
62
+ <br/>
63
+ <?php
64
+ $shipping_arrival_date = $_order->getShippingArrivalDate();
65
+
66
+ $date_format = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverydate_format');
67
+ $time_format = Mage::getStoreConfig('deliverydate/deliverydate_general/deliverytime_format');
68
+ if ($date_format=='')
69
+ $date_format='d/M/Y';
70
+ if($time_format=='')
71
+ $date_format.=" ,g:i a";
72
+ else
73
+ $date_format.=" ".$time_format;
74
+ if ($shipping_arrival_date!='')
75
+ echo "Shipping Arrival Date :- ".$currentDate = date ($date_format,strtotime($shipping_arrival_date));
76
+ else
77
+ echo "Shipping Arrival Date :- N/A";
78
+ ?>
79
+ <br/>
80
+ <?php
81
+ if ($_order->getShippingArrivalComments()!='')
82
+ echo $_order->getShippingArrivalComments();
83
+ ?>
84
+ <?php else: ?>
85
+ <p><?php echo $this->helper('sales')->__('No shipping information available'); ?></p>
86
+ <?php endif; ?>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ <?php endif; ?>
92
+ <div class="col2-set order-info-box">
93
+ <div class="col-1">
94
+ <div class="box">
95
+ <div class="box-title">
96
+ <h2><?php echo $this->__('Billing Address') ?></h2>
97
+ </div>
98
+ <div class="box-content">
99
+ <address><?php echo $_order->getBillingAddress()->format('html') ?></address>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ <div class="col-2">
104
+ <div class="box box-payment">
105
+ <div class="box-title">
106
+ <h2><?php echo $this->__('Payment Method') ?></h2>
107
+ </div>
108
+ <div class="box-content">
109
+ <?php echo $this->getPaymentInfoHtml() ?>
110
+ </div>
111
+ </div>
112
+ </div>
113
+ </div>
app/design/frontend/default/default/template/deliverydate/review/info.phtml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <?php echo $this->getChildHtml('items_before'); ?>
17
+ <div id="checkout-review-table-wrapper">
18
+ <table class="data-table" id="checkout-review-table">
19
+ <?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
20
+ <col />
21
+ <col width="1" />
22
+ <col width="1" />
23
+ <col width="1" />
24
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
25
+ <col width="1" />
26
+ <col width="1" />
27
+ <?php endif; ?>
28
+ <thead>
29
+ <tr>
30
+ <th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
31
+ <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
32
+ <th rowspan="<?php echo $rowspan ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
33
+ <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Subtotal') ?></th>
34
+ </tr>
35
+ <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
36
+ <tr>
37
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
38
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
39
+ <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
40
+ <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
41
+ </tr>
42
+ <?php endif; ?>
43
+ </thead>
44
+ <?php echo $this->getChildHtml('totals'); ?>
45
+ <tbody>
46
+ <?php foreach($this->getItems() as $_item): ?>
47
+ <?php echo $this->getItemHtml($_item)?>
48
+ <?php endforeach ?>
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+ <?php echo $this->getChildHtml('items_after'); ?>
53
+ <script type="text/javascript">
54
+ //<![CDATA[
55
+ decorateTable('checkout-review-table');
56
+ truncateOptions();
57
+ //]]>
58
+ </script>
59
+ <div id="checkout-review-submit">
60
+ <?php echo $this->getChildHtml('agreements') ?>
61
+ <?php if (version_compare(Mage::getVersion(), '1.5.1.0', '>')) { ?>
62
+ <div class="buttons-set" id="review-buttons-container">
63
+
64
+ <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>
65
+
66
+ <?php echo $this->getChildHtml('button') ?>
67
+ <span class="please-wait" id="review-please-wait" style="display:none;">
68
+ <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...') ?>
69
+ </span>
70
+ </div>
71
+ <?php } ?>
72
+ <script type="text/javascript">
73
+ //<![CDATA[
74
+ review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
75
+ //]]>
76
+ </script>
77
+ </div>
app/design/frontend/default/default/template/deliverydate/shipping_method/available.phtml ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * NOTICE OF LICENSE
4
+ *
5
+ * This source file is subject to the Open Software License (OSL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://opensource.org/licenses/osl-3.0.php
9
+ *
10
+ * @category Softprodigy
11
+ * @package Softprodigy_Deliverydate
12
+ * @copyright Copyright (c) 2014 SoftProdigy <magento@softprodigy.com>
13
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14
+ */
15
+ ?>
16
+ <?php /** @var $this Mage_Checkout_Block_Onepage_Shipping_Method_Available */ ?>
17
+ <?php $_shippingRateGroups = $this->getShippingRates(); ?>
18
+ <?php if (!$_shippingRateGroups): ?>
19
+ <p><?php echo $this->__('Sorry, no quotes are available for this order at this time.') ?></p>
20
+ <?php else: ?>
21
+
22
+ <dl class="sp-methods">
23
+ <?php $shippingCodePrice = array(); ?>
24
+ <?php $_sole = count($_shippingRateGroups) == 1; foreach ($_shippingRateGroups as $code => $_rates): ?>
25
+ <dt><?php echo $this->escapeHtml($this->getCarrierName($code)) ?></dt>
26
+ <dd>
27
+ <ul>
28
+ <?php $_sole = $_sole && count($_rates) == 1; foreach ($_rates as $_rate): ?>
29
+ <?php $shippingCodePrice[] = "'".$_rate->getCode()."':".(float)$_rate->getPrice(); ?>
30
+ <li>
31
+ <?php if ($_rate->getErrorMessage()): ?>
32
+ <ul class="messages"><li class="error-msg"><ul><li><?php echo $this->escapeHtml($_rate->getErrorMessage()) ?></li></ul></li></ul>
33
+ <?php else: ?>
34
+ <?php if ($_sole) : ?>
35
+ <span class="no-display"><input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>" checked="checked" /></span>
36
+ <?php else: ?>
37
+ <input name="shipping_method" type="radio" value="<?php echo $_rate->getCode() ?>" id="s_method_<?php echo $_rate->getCode() ?>"<?php if($_rate->getCode()===$this->getAddressShippingMethod()) echo ' checked="checked"' ?> class="radio"/>
38
+
39
+ <?php if ($_rate->getCode() === $this->getAddressShippingMethod()): ?>
40
+ <script type="text/javascript">
41
+ //<![CDATA[
42
+ lastPrice = <?php echo (float)$_rate->getPrice(); ?>;
43
+ //]]>
44
+ </script>
45
+ <?php endif; ?>
46
+
47
+ <?php endif; ?>
48
+ <label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>
49
+ <?php $_excl = $this->getShippingPrice($_rate->getPrice(), $this->helper('tax')->displayShippingPriceIncludingTax()); ?>
50
+ <?php $_incl = $this->getShippingPrice($_rate->getPrice(), true); ?>
51
+ <?php echo $_excl; ?>
52
+ <?php if ($this->helper('tax')->displayShippingBothPrices() && $_incl != $_excl): ?>
53
+ (<?php echo $this->__('Incl. Tax'); ?> <?php echo $_incl; ?>)
54
+ <?php endif; ?>
55
+ </label>
56
+ <?php endif ?>
57
+ </li>
58
+ <?php endforeach; ?>
59
+ </ul>
60
+ </dd>
61
+ <?php endforeach; ?>
62
+ <?php
63
+ if (Mage::getStoreConfig('deliverydate/deliverydate_general/on_which_page')==1){
64
+ echo $this->getLayout()->createBlock('deliverydate/deliverydate')->setTemplate('deliverydate/deliverydate.phtml')->toHtml();
65
+ }
66
+ ?>
67
+ </dl>
68
+ <script type="text/javascript">
69
+ //<![CDATA[
70
+ <?php if (!empty($shippingCodePrice)): ?>
71
+ var shippingCodePrice = {<?php echo implode(',',$shippingCodePrice); ?>};
72
+ <?php endif; ?>
73
+
74
+ $$('input[type="radio"][name="shipping_method"]').each(function(el){
75
+ Event.observe(el, 'click', function(){
76
+ if (el.checked == true) {
77
+ var getShippingCode = el.getValue();
78
+ <?php if (!empty($shippingCodePrice)): ?>
79
+ var newPrice = shippingCodePrice[getShippingCode];
80
+ if (!lastPrice) {
81
+ lastPrice = newPrice;
82
+ quoteBaseGrandTotal += newPrice;
83
+ }
84
+ if (newPrice != lastPrice) {
85
+ quoteBaseGrandTotal += (newPrice-lastPrice);
86
+ lastPrice = newPrice;
87
+ }
88
+ <?php endif; ?>
89
+ checkQuoteBaseGrandTotal = quoteBaseGrandTotal;
90
+ return false;
91
+ }
92
+ });
93
+ });
94
+ //]]>
95
+ </script>
96
+ <?php endif; ?>
package.xml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>SoftProdigy_DeliveryDate</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/gpl-license.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This Extension helps to keep a track of shipping and delivery dates of products for e-commerce stores.</summary>
10
+ <description>&lt;p&gt; Keeping track of the shipping and delivery dates can be quite a confusing task for the person who is shopping online as well as the store owner. SoftProdigy has tried to make this task simpler by introducing an effective extension that does the work for you. The Order Delivery Date Magento Extension is a great way to serve customer interests by giving them a convenient option to request a date of shipment and delivery. This request is recorded and can be checked by the admin. It can be referred to when dispatching the order.&lt;/p&gt;&#xD;
11
+ &lt;p&gt;The extension has been made to handle the tasks relating to setting a shipping as well as delivery date simpler. The order management process is streamlined which helps save time and effort. A user can simply assign a date of shipment and delivery on the order page which shall be followed by the online retailer. The step on which the dates need to be defined can be set by the admin himself.&lt;/p&gt;&#xD;
12
+ </description>
13
+ <notes>This Extension helps to keep a track of shipping and delivery dates of products for e-commerce stores.</notes>
14
+ <authors><author><name>SoftProdigyIN</name><user>SoftProdigyIN</user><email>magento@softprodigy.com</email></author></authors>
15
+ <date>2014-08-28</date>
16
+ <time>13:22:16</time>
17
+ <contents><target name="magelocal"><dir name="Softprodigy"><dir name="Deliverydate"><dir name="Block"><dir name="Adminhtml"><dir name="Deliverydate"><dir name="Edit"><file name="Form.php" hash="25540d936dbaba8c1c14eb2f89f3bcd1"/><dir name="Tab"><file name="Form.php" hash="a7dd3aa849b737afb725700676322ff0"/></dir><file name="Tabs.php" hash="76f5d46de02511c6dc437dd27d0a136e"/></dir><file name="Edit.php" hash="cb028c464c4e0a2bee68070f2ea13df6"/><file name="Grid.php" hash="3325a26405e131287bbf81db07cd9c16"/></dir><file name="Deliverydate.php" hash="11611b4dfc5bc2e48c1f6a690a986ae3"/></dir><file name="Deliverydate.php" hash="f374394325a18ea040665d57047bdfb4"/><dir name="Email"><file name="Info.php" hash="ff88ccb7074103b2cad1c781df7ce978"/></dir><dir name="Order"><file name="Info.php" hash="2566ba031a870ee9699b54285b6e2fc1"/></dir></dir><dir name="Helper"><file name="Data.php" hash="0fa06ca11443fded446669809d0238ec"/></dir><dir name="Model"><dir name="Config"><file name="Dateformat.php" hash="06be22eb2787dbfe0f6a820963852730"/><file name="Dayoff.php" hash="c16202abf898627bc167b09077e5698b"/><file name="Option.php" hash="d4124023e6a4948a92246370fb939ba4"/><file name="Timeformat.php" hash="bfd101220b94736cb6179f9c6ccc60cd"/></dir><file name="Deliverydate.php" hash="0612cf5ad66c95db1967bfc53ec5f540"/><dir name="Mysql4"><dir name="Deliverydate"><file name="Collection.php" hash="d82897b94784e3c8fa5cfcacdf15a34c"/></dir><file name="Deliverydate.php" hash="31f6f774b931795de0010c9202c63e1b"/></dir><file name="Observer.php" hash="75df1c6e8ff15140e9992f711f755773"/><file name="Status.php" hash="f70de91fa683300af0e3e132e9b0b1b8"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DeliverydateController.php" hash="8b6b64d6f74b4103c50eadffab1ee66a"/></dir><file name="IndexController.php" hash="507686ac48dffda312c90dca3261803f"/></dir><dir name="etc"><file name="config.xml" hash="282caca4832037d984c78a66722853f2"/><file name="system.xml" hash="8e26f7dbb18d6bcca1375bdc568997c0"/></dir><dir name="sql"><dir name="deliverydate_setup"><file name="mysql4-install-0.1.0.php" hash="eda811814023a89a9590bde0e47027b1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="."><file name="Softprodigy_Deliverydate.xml" hash=""/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="deliverydate.xml" hash="4a81fe7acd344127ec1db12dd218a2ba"/></dir><dir name="template"><dir name="deliverydate"><file name="date.phtml" hash="b2a81adb6f43ca04253369bbdd87d85e"/><file name="info.phtml" hash="743a27c09757cbbe3e328e70514bea1b"/><dir name="js"><file name="calendar.phtml" hash="4aebae28d9328582e09c6295deb135d4"/></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="deliverydate.xml" hash="0024db3bbcc4cf9b6aba6eb00b7ee469"/></dir><dir name="template"><dir name="deliverydate"><file name="agreements.phtml" hash="5f90e2e1ada6b72b915cfe28e43b3c25"/><file name="deliverydate.phtml" hash="940eb7ec96dbc974278e82e4128d6272"/><dir name="email"><file name="info.phtml" hash="3bf8239230e908fe594213f4a6378ece"/></dir><dir name="js"><file name="calendar.phtml" hash="4aebae28d9328582e09c6295deb135d4"/></dir><dir name="order"><file name="info.phtml" hash="58618054b05e158fdba2c38f52615043"/></dir><dir name="review"><file name="info.phtml" hash="4590bd9ef7b2c54599d507232b9543bb"/></dir><dir name="shipping_method"><file name="available.phtml" hash="3ede159d1d0035d1bdf52c756d183437"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><file name="ico_reset.png" hash="b5f3195305024564e387bc15ebadcc7c"/></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="images"><file name="ico_reset.png" hash="b5f3195305024564e387bc15ebadcc7c"/></dir></dir></dir></dir></target></contents>
18
+ <compatible/>
19
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.5.0</min><max>1.9.1</max></package></required></dependencies>
20
+ </package>
skin/adminhtml/default/default/images/ico_reset.png ADDED
Binary file
skin/frontend/default/default/images/ico_reset.png ADDED
Binary file