Ti_OrderComment - Version 1.1.0

Version Notes

Order comment module for magento

Download this release

Release Info

Developer Ti
Extension Ti_OrderComment
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

app/code/community/Ti/OrderComment/Block/Adminhtml/Sales/Order/Grid.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ class Ti_OrderComment_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
12
+ {
13
+ /**
14
+ * Columns, that become ambiguous after join
15
+ *
16
+ * @var array
17
+ */
18
+
19
+
20
+ protected $_ambiguousColumns = array(
21
+ 'status',
22
+ 'created_at',
23
+ );
24
+
25
+ /**
26
+ * Retrieve collection class
27
+ *
28
+ * @return string
29
+ */
30
+ protected function _getCollectionClass()
31
+ {
32
+ $status = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_enable');
33
+ if($status==1) {
34
+ return 'ordercomment/order_grid_collection';
35
+ }
36
+ else
37
+ return parent::_getCollectionClass();
38
+ }
39
+
40
+ /**
41
+ * Prepare grid columns
42
+ *
43
+ * @return Ti_OrderComment_Block_Adminhtml_Sales_Order_Grid
44
+ */
45
+ protected function _prepareColumns()
46
+ {
47
+ $status = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_enable');
48
+ if($status==1) {
49
+
50
+ parent::_prepareColumns();
51
+ // Add order comment to grid
52
+ $this->addColumn('ordercomment', array(
53
+ 'header' => Mage::helper('ordercomment')->__('Order Comment'),
54
+ 'index' => 'ordercomment',
55
+ 'filter_index' => 'ordercomment_table.comment',
56
+ ));
57
+
58
+ // Fix integrity constraint violation in SELECT
59
+ foreach ($this->_ambiguousColumns as $index) {
60
+ if (isset($this->_columns[$index])) {
61
+ $this->_columns[$index]->setFilterIndex('main_table.' . $index);
62
+ }
63
+ }
64
+
65
+ return $this;
66
+ }
67
+ else
68
+ return parent::_prepareColumns();
69
+ }
70
+
71
+ /**
72
+ * Prepare grid massactions
73
+ *
74
+ * @return Ti_OrderComment_Block_Adminhtml_Sales_Order_Grid
75
+ */
76
+ protected function _prepareMassaction()
77
+ {
78
+ parent::_prepareMassaction();
79
+
80
+ // VERY dirty hack to resolve conflict with Seamless Delete Order
81
+ $modules = (array)Mage::getConfig()->getNode('modules')->children();
82
+ if (isset($modules['EM_DeleteOrder']) && $modules['EM_DeleteOrder']->is('active')) {
83
+ $this->getMassactionBlock()->addItem('delete_order', array(
84
+ 'label'=> Mage::helper('sales')->__('Delete order'),
85
+ 'url' => $this->getUrl('*/sales_order/deleteorder'),
86
+ ));
87
+ }
88
+ return $this;
89
+ }
90
+ }
app/code/community/Ti/OrderComment/Block/Checkout/Agreements.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ class Ti_OrderComment_Block_Checkout_Agreements extends Mage_Checkout_Block_Agreements
12
+ {
13
+ /**
14
+ * Override block template
15
+ *
16
+ * @return string
17
+ */
18
+
19
+
20
+
21
+ protected function _toHtml()
22
+ {
23
+ $status = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_enable');
24
+ if($status==1) {
25
+ $this->setTemplate('ordercomment/checkout/agreements.phtml');
26
+ return parent::_toHtml();
27
+ }
28
+ }
29
+ }
app/code/community/Ti/OrderComment/Helper/Data.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ class Ti_OrderComment_Helper_Data extends Mage_Core_Helper_Abstract
12
+ {
13
+
14
+ }
app/code/community/Ti/OrderComment/Model/Mysql4/Order/Grid/Collection.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ class Ti_OrderComment_Model_Mysql4_Order_Grid_Collection extends Mage_Sales_Model_Resource_Order_Grid_Collection
12
+ {
13
+ }
app/code/community/Ti/OrderComment/Model/Observer.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ class Ti_OrderComment_Model_Observer extends Varien_Object
12
+ {
13
+ /**
14
+ * Save comment from agreement form to order
15
+ *
16
+ * @param $observer
17
+ */
18
+ public function saveOrderComment($observer)
19
+ {
20
+ $customComment = "";
21
+ $orderComment = Mage::app()->getRequest()->getPost('ordercomment');
22
+ $customComment = Mage::app()->getRequest()->getPost('custom_comment');
23
+
24
+ if (is_array($orderComment) && isset($orderComment['comment']) && $customComment!='') {
25
+
26
+ $comment = trim($orderComment['comment']);
27
+ $cust_comment = trim($customComment);
28
+ $commentCombined = '['.$comment.'] '.$cust_comment;
29
+
30
+ if (!empty($comment)) {
31
+
32
+ $order = $observer->getEvent()->getOrder();
33
+ $order->setCustomerComment($commentCombined);
34
+ $order->setCustomerNoteNotify(true);
35
+ $order->setCustomerNote($commentCombined);
36
+ }
37
+ }
38
+ else if (is_array($orderComment) && isset($orderComment['comment']) && $customComment=='') {
39
+
40
+ $comment = trim($orderComment['comment']);
41
+
42
+ if (!empty($comment)) {
43
+
44
+ $order = $observer->getEvent()->getOrder();
45
+ $order->setCustomerComment($comment);
46
+ $order->setCustomerNoteNotify(true);
47
+ $order->setCustomerNote($comment);
48
+ }
49
+ }
50
+ else if ($orderComment=='' && $customComment!='') {
51
+
52
+ $cust_comment = trim($customComment);
53
+ $order = $observer->getEvent()->getOrder();
54
+ $order->setCustomerComment($cust_comment);
55
+ $order->setCustomerNoteNotify(true);
56
+ $order->setCustomerNote($cust_comment);
57
+
58
+ }
59
+
60
+ }
61
+ }
app/code/community/Ti/OrderComment/Model/Resource/Order/Grid/Collection.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ class Ti_OrderComment_Model_Resource_Order_Grid_Collection extends Mage_Sales_Model_Mysql4_Order_Grid_Collection
12
+ {
13
+ /**
14
+ * Init collection select
15
+ *
16
+ * @return Mage_Core_Model_Resource_Db_Collection_Abstract
17
+ */
18
+ protected function _initSelect()
19
+ {
20
+ parent::_initSelect();
21
+
22
+ // Join order comment
23
+ $this->getSelect()->joinLeft(
24
+ array('ordercomment_table' => $this->getTable('sales/order_status_history')),
25
+ 'main_table.entity_id = ordercomment_table.parent_id AND ordercomment_table.comment IS NOT NULL',
26
+ array(
27
+ 'ordercomment' => 'ordercomment_table.comment',
28
+ )
29
+ )->group('main_table.entity_id');
30
+
31
+ return $this;
32
+ }
33
+
34
+ /**
35
+ * Init collection count select
36
+ *
37
+ * @return Varien_Db_Select
38
+ */
39
+ public function getSelectCountSql()
40
+ {
41
+ return parent::getSelectCountSql()->reset(Zend_Db_Select::GROUP);
42
+ }
43
+ }
app/code/community/Ti/OrderComment/etc/config.xml ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!-- /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+ -->
11
+ <config>
12
+ <modules>
13
+ <Ti_OrderComment>
14
+ <version>1.0.1</version>
15
+ </Ti_OrderComment>
16
+ </modules>
17
+ <global>
18
+ <models>
19
+ <ordercomment>
20
+ <class>Ti_OrderComment_Model</class>
21
+ <resourceModel>ordercomment_resource</resourceModel>
22
+ </ordercomment>
23
+ <ordercomment_resource>
24
+ <class>Ti_OrderComment_Model_Resource</class>
25
+ <deprecatedNode>ordercomment_mysql4</deprecatedNode>
26
+ </ordercomment_resource>
27
+ <sales_resource>
28
+ <rewrite>
29
+ <order_grid_collection>Ti_OrderComment_Model_Mysql4_Order_Grid_Collection</order_grid_collection>
30
+ </rewrite>
31
+ </sales_resource>
32
+ </models>
33
+ <helpers>
34
+ <ordercomment>
35
+ <class>Ti_OrderComment_Helper</class>
36
+ </ordercomment>
37
+ </helpers>
38
+ <blocks>
39
+ <ordercomment>
40
+ <class>Ti_OrderComment_Block</class>
41
+ </ordercomment>
42
+ <checkout>
43
+ <rewrite>
44
+ <agreements>Ti_OrderComment_Block_Checkout_Agreements</agreements>
45
+ </rewrite>
46
+ </checkout>
47
+ <adminhtml>
48
+ <rewrite>
49
+ <sales_order_grid>Ti_OrderComment_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
50
+ </rewrite>
51
+ </adminhtml>
52
+ </blocks>
53
+ </global>
54
+ <frontend>
55
+ <events>
56
+ <checkout_type_onepage_save_order>
57
+ <observers>
58
+ <saveCustomerComment>
59
+ <class>Ti_OrderComment_Model_Observer</class>
60
+ <method>saveOrderComment</method>
61
+ </saveCustomerComment>
62
+ </observers>
63
+ </checkout_type_onepage_save_order>
64
+ <checkout_type_multishipping_create_orders_single>
65
+ <observers>
66
+ <saveCustomerComment>
67
+ <class>Ti_OrderComment_Model_Observer</class>
68
+ <method>saveOrderComment</method>
69
+ </saveCustomerComment>
70
+ </observers>
71
+ </checkout_type_multishipping_create_orders_single>
72
+ </events>
73
+ </frontend>
74
+ <adminhtml>
75
+ <acl>
76
+ <resources>
77
+ <admin>
78
+ <children>
79
+ <system>
80
+ <children>
81
+ <config>
82
+ <children>
83
+ <ordercomment translate="title" module="ti_ordercomment">
84
+ <title>Order Comment Settings</title>
85
+ </ordercomment>
86
+ </children>
87
+ </config>
88
+ </children>
89
+ </system>
90
+ </children>
91
+ </admin>
92
+ </resources>
93
+ </acl>
94
+ </adminhtml>
95
+ <default>
96
+ <ordercomment>
97
+ <ordercomment_group>
98
+ <ordercomment_enable>1</ordercomment_enable>
99
+ </ordercomment_group>
100
+ </ordercomment>
101
+ </default>
102
+ </config>
app/code/community/Ti/OrderComment/etc/system.xml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <ti translate="label" module="ordercomment">
5
+ <label>Ti</label>
6
+ <sort_order>110</sort_order>
7
+ </ti>
8
+ </tabs>
9
+ <sections>
10
+ <ordercomment translate="label" module="ordercomment">
11
+ <label>Order Comment</label>
12
+ <tab>ti</tab>
13
+ <sort_order>1050</sort_order>
14
+ <show_in_default>1</show_in_default>
15
+ <show_in_website>1</show_in_website>
16
+ <show_in_store>1</show_in_store>
17
+ <groups>
18
+ <ordercomment_group translate="label" module="ordercomment">
19
+ <label>Order Comment Settings</label>
20
+ <frontend_type>text</frontend_type>
21
+ <sort_order>1008</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <ordercomment_enable translate="label">
27
+ <label>Enable Order Comment Module</label>
28
+ <comment>If selected 'yes' then facility to add comments in checkout page will be available</comment>
29
+ <frontend_type>select</frontend_type>
30
+ <sort_order>90</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ <source_model>adminhtml/system_config_source_yesno</source_model>
35
+ </ordercomment_enable>
36
+ <ordercomment_question translate="label">
37
+ <label>Question/Title</label>
38
+ <comment>Title/Question to display in front end</comment>
39
+ <frontend_type>text</frontend_type>
40
+ <sort_order>91</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </ordercomment_question>
45
+ <ordercomment_comments translate="label">
46
+ <label>Answer/Message</label>
47
+ <comment>Answer/Message to display in front end. Seperate each messages with semi-colon (;)</comment>
48
+ <frontend_type>textarea</frontend_type>
49
+ <sort_order>94</sort_order>
50
+ <rows>10</rows>
51
+ <cols>30</cols>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ </ordercomment_comments>
56
+ <ordercomment_boxtitle translate="label">
57
+ <label>Comment box title</label>
58
+ <comment>Comment box title to display in front end</comment>
59
+ <frontend_type>text</frontend_type>
60
+ <sort_order>91</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ </ordercomment_boxtitle>
65
+ </fields>
66
+ </ordercomment_group>
67
+ </groups>
68
+ </ordercomment>
69
+ </sections>
70
+ </config>
app/design/frontend/default/default/template/ordercomment/checkout/agreements.phtml ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ ?>
12
+ <style>
13
+ .buttons-set {
14
+ text-align: left;
15
+ }
16
+ </style>
17
+ <form action="" id="checkout-agreements" onsubmit="return false;">
18
+ <div class="buttons-set">
19
+ <ul class="form-list">
20
+ <li>
21
+ <fieldset>
22
+ <ul>
23
+ <li class="wide">
24
+ <label for="ordercomment-comment"><?php echo $feedbackTitle = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_question'); ?></label>
25
+ <div class="input-box">
26
+ <?php
27
+ $comments = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_comments');
28
+ $oneByOne = explode(";", $comments);
29
+ foreach($oneByOne as $comment) {
30
+ if($comment){
31
+ ?>
32
+ <li class="control">
33
+ <input type="radio" id="ordercomment-comment" name="ordercomment[comment]" value="<?php echo trim($comment); ?>"><?php echo '&nbsp;'.trim($comment); ?>
34
+ </li>
35
+ <?php
36
+ }
37
+ }
38
+ ?>
39
+ <li class="control"><?php echo $feedbackTitle = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_boxtitle'); ?></label>
40
+ </li>
41
+ <li class="control">
42
+ <textarea name="custom_comment" id="custom_comment" rows="10" cols="60"></textarea>
43
+ </li>
44
+ </div>
45
+
46
+ </li>
47
+ </ul>
48
+ </fieldset>
49
+ </li>
50
+ </ul>
51
+ </div>
52
+
53
+ <?php if ($this->getAgreements()): ?>
54
+ <ol class="checkout-agreements">
55
+ <?php foreach ($this->getAgreements() as $_a): ?>
56
+ <li>
57
+ <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
58
+ <?php if ($_a->getIsHtml()):?>
59
+ <?php echo $_a->getContent() ?>
60
+ <?php else:?>
61
+ <?php echo nl2br($this->htmlEscape($_a->getContent())) ?>
62
+ <?php endif; ?>
63
+ </div>
64
+ <p class="agree">
65
+ <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>
66
+ </p>
67
+ </li>
68
+ <?php endforeach ?>
69
+ </ol>
70
+ <?php endif; ?>
71
+ </form>
app/design/frontend/rwd/default/template/ordercomment/checkout/agreements.phtml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Ti Order Comment Module
4
+ *
5
+ * @category Ti
6
+ * @package Ti_OrderComment
7
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
8
+ * @link http://www.titechnologies.in
9
+ */
10
+
11
+ ?>
12
+ <style>
13
+ .buttons-set {
14
+ text-align: left;
15
+ }
16
+
17
+ @media only screen and (max-width : 480px) {
18
+
19
+ #custom_comment
20
+ {
21
+ width:100%;
22
+ }
23
+
24
+ }
25
+ </style>
26
+ <form action="" id="checkout-agreements" onsubmit="return false;">
27
+ <div class="buttons-set">
28
+ <ul class="form-list">
29
+ <li>
30
+ <fieldset>
31
+ <ul>
32
+ <li class="wide">
33
+ <label for="ordercomment-comment"><?php echo $feedbackTitle = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_question'); ?></label>
34
+ <div class="input-box">
35
+ <?php
36
+ $comments = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_comments');
37
+ $oneByOne = explode(";", $comments);
38
+ foreach($oneByOne as $comment) {
39
+ if($comment){
40
+ ?>
41
+ <li class="control">
42
+ <input type="radio" id="ordercomment-comment" name="ordercomment[comment]" value="<?php echo trim($comment); ?>"><?php echo '&nbsp;'.trim($comment); ?>
43
+ </li>
44
+ <?php
45
+ }
46
+ }
47
+ ?>
48
+ <li class="control"><?php echo $feedbackTitle = Mage::getStoreConfig('ordercomment/ordercomment_group/ordercomment_boxtitle'); ?></label>
49
+ </li>
50
+ <li class="control">
51
+ <textarea name="custom_comment" id="custom_comment" rows="10" cols="60"></textarea>
52
+ </li>
53
+ </div>
54
+
55
+ </li>
56
+ </ul>
57
+ </fieldset>
58
+ </li>
59
+ </ul>
60
+ </div>
61
+
62
+ <?php if ($this->getAgreements()): ?>
63
+ <ol class="checkout-agreements">
64
+ <?php foreach ($this->getAgreements() as $_a): ?>
65
+ <li>
66
+ <div class="agreement-content"<?php echo ($_a->getContentHeight() ? ' style="height:' . $_a->getContentHeight() . '"' : '')?>>
67
+ <?php if ($_a->getIsHtml()):?>
68
+ <?php echo $_a->getContent() ?>
69
+ <?php else:?>
70
+ <?php echo nl2br($this->htmlEscape($_a->getContent())) ?>
71
+ <?php endif; ?>
72
+ </div>
73
+ <p class="agree">
74
+ <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>
75
+ </p>
76
+ </li>
77
+ <?php endforeach ?>
78
+ </ol>
79
+ <?php endif; ?>
80
+ </form>
app/etc/modules/Ti_OrderComment.xml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ /**
4
+ * Ti Order Comment Module
5
+ *
6
+ * @category Ti
7
+ * @package Ti_OrderComment
8
+ * @copyright Copyright (c) 2014 Ti Technologies (http://www.titechnologies.in)
9
+ * @link http://www.titechnologies.in
10
+ */
11
+
12
+ -->
13
+ <config>
14
+ <modules>
15
+ <Ti_OrderComment>
16
+ <active>true</active>
17
+ <codePool>community</codePool>
18
+ <depends>
19
+ <Mage_Checkout />
20
+ <Mage_Sales />
21
+ </depends>
22
+ </Ti_OrderComment>
23
+ </modules>
24
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Ti_OrderComment</name>
4
+ <version>1.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>OSL</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Order comment module for magento</summary>
10
+ <description>Order comment module for magento</description>
11
+ <notes>Order comment module for magento</notes>
12
+ <authors><author><name>Ti</name><user>titech</user><email>info@titechnologies.in</email></author></authors>
13
+ <date>2015-01-20</date>
14
+ <time>14:16:57</time>
15
+ <contents><target name="magecommunity"><dir name="Ti"><dir name="OrderComment"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="3330745445e5dc2d54aa3b7001dd48f9"/></dir></dir></dir><dir name="Checkout"><file name="Agreements.php" hash="62f63e7f852a5b791d29c95af8026c64"/></dir></dir><dir name="Helper"><file name="Data.php" hash="bed37aebfe9851d079ae448465c9f165"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="1cd9c647a4bff03975d9a9bfbb0c8a9b"/></dir></dir></dir><file name="Observer.php" hash="365cfa588868790a555c322e61448532"/><dir name="Resource"><dir name="Order"><dir name="Grid"><file name="Collection.php" hash="76958c5ec416fc5b5b2f6f286609b223"/></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="1a44e9b75f4ceb6bb2625829c27f5ec8"/><file name="system.xml" hash="d656f6fe0b273fc3778dc6ce27b5cea9"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="ordercomment"><dir name="checkout"><file name="agreements.phtml" hash="dc7bd31dc17203174dceb63829dcfbb0"/></dir></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="ordercomment"><dir name="checkout"><file name="agreements.phtml" hash="709a223b6da776a28c8051bfa0fc8c73"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ti_OrderComment.xml" hash="829e5d3bde99e55ed72584aca5696721"/></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>