Ti_OrderComment - Version 1.1.2

Version Notes

Order comment module for magento

Download this release

Release Info

Developer Ti
Extension Ti_OrderComment
Version 1.1.2
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.2

app/code/community/Ti/OrderComment/Block/Order/View.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Ti_OrderComment_Block_Order_View extends Mage_Core_Block_Template
4
+ {
5
+ protected function _construct()
6
+ {
7
+
8
+ parent::_construct();
9
+ $this->setTemplate('ordercomment/sales/order/orderhistorycomment.phtml');
10
+ }
11
+
12
+ protected function _prepareLayout()
13
+ {
14
+ if ($headBlock = $this->getLayout()->getBlock('head')) {
15
+ $headBlock->setTitle($this->__('Order # %s', $this->getOrder()->getRealOrderId()));
16
+ }
17
+ $this->setChild(
18
+ 'payment_info',
19
+ $this->helper('payment')->getInfoBlock($this->getOrder()->getPayment())
20
+ );
21
+ }
22
+
23
+ public function getPaymentInfoHtml()
24
+ {
25
+ return $this->getChildHtml('payment_info');
26
+ }
27
+
28
+ /**
29
+ * Retrieve current order model instance
30
+ *
31
+ * @return Mage_Sales_Model_Order
32
+ */
33
+ public function getOrder()
34
+ {
35
+ return Mage::registry('current_order');
36
+ }
37
+
38
+ /**
39
+ * Return back url for logged in and guest users
40
+ *
41
+ * @return string
42
+ */
43
+ public function getBackUrl()
44
+ {
45
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
46
+ return Mage::getUrl('*/*/history');
47
+ }
48
+ return Mage::getUrl('*/*/form');
49
+ }
50
+
51
+ /**
52
+ * Return back title for logged in and guest users
53
+ *
54
+ * @return string
55
+ */
56
+ public function getBackTitle()
57
+ {
58
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
59
+ return Mage::helper('sales')->__('Back to My Orders');
60
+ }
61
+ return Mage::helper('sales')->__('View Another Order');
62
+ }
63
+
64
+ public function getInvoiceUrl($order)
65
+ {
66
+ return Mage::getUrl('*/*/invoice', array('order_id' => $order->getId()));
67
+ }
68
+
69
+ public function getShipmentUrl($order)
70
+ {
71
+ return Mage::getUrl('*/*/shipment', array('order_id' => $order->getId()));
72
+ }
73
+
74
+ public function getCreditmemoUrl($order)
75
+ {
76
+ return Mage::getUrl('*/*/creditmemo', array('order_id' => $order->getId()));
77
+ }
78
+
79
+ }
app/code/community/Ti/OrderComment/Helper/Data.php CHANGED
@@ -11,4 +11,20 @@
11
  class Ti_OrderComment_Helper_Data extends Mage_Core_Helper_Abstract
12
  {
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
11
  class Ti_OrderComment_Helper_Data extends Mage_Core_Helper_Abstract
12
  {
13
 
14
+ /**
15
+ * Get product image url in grid
16
+ *
17
+ * @param string $order_id -pass order id
18
+ * @return string
19
+ */
20
+
21
+ public function getordercomments($order_id){
22
+ $collection = Mage::getModel('sales/order_status_history')->getCollection();
23
+ $collection->getSelect()->order('entity_id DESC');
24
+ $collection->addFieldToFilter('parent_id',$order_id);
25
+ foreach ($collection as $row) {
26
+ $comments=$row['comment'];
27
+ }
28
+ return $comments;
29
+ }
30
  }
app/code/community/Ti/OrderComment/etc/config.xml CHANGED
@@ -11,7 +11,7 @@
11
  <config>
12
  <modules>
13
  <Ti_OrderComment>
14
- <version>1.0.1</version>
15
  </Ti_OrderComment>
16
  </modules>
17
  <global>
@@ -44,15 +44,20 @@
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>
11
  <config>
12
  <modules>
13
  <Ti_OrderComment>
14
+ <version>1.1.2</version>
15
  </Ti_OrderComment>
16
  </modules>
17
  <global>
44
  <agreements>Ti_OrderComment_Block_Checkout_Agreements</agreements>
45
  </rewrite>
46
  </checkout>
47
+ <sales>
48
+ <rewrite>
49
+ <order_view>Ti_OrderComment_Block_Order_View</order_view>
50
+ </rewrite>
51
+ </sales>
52
  <adminhtml>
53
  <rewrite>
54
  <sales_order_grid>Ti_OrderComment_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
55
  </rewrite>
56
  </adminhtml>
57
  </blocks>
58
+ </global>
59
  <frontend>
60
+ <events>
61
  <checkout_type_onepage_save_order>
62
  <observers>
63
  <saveCustomerComment>
app/design/frontend/default/default/template/ordercomment/sales/order/orderhistorycomment.phtml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_order = $this->getOrder() ?>
2
+ <?php
3
+ //#19494 works to display ordercomments
4
+ echo '<dl class="order-info">';
5
+ echo '<dt>'.$this->__('Order Comments :').'</dt>';
6
+ echo '<dd>'.Mage::helper('ordercomment')->getordercomments($_order->getEntityId()).'</dd>';
7
+ echo '</dl>';
8
+ //#19494 works to display ordercomments
9
+ ?>
10
+
11
+ <div class="order-items order-details">
12
+ <?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('items', $this->getOrder())): ?>
13
+ <script type="text/javascript">
14
+ //<![CDATA[
15
+ function giftMessageToogle(giftMessageIdentifier)
16
+ {
17
+ var link = $('order-item-gift-message-link-'+giftMessageIdentifier);
18
+ var container = $('order-item-gift-message-'+giftMessageIdentifier);
19
+ var row = $('order-item-row-'+giftMessageIdentifier);
20
+ if(link.expanded) {
21
+ link.expanded = false;
22
+ link.removeClassName('expanded');
23
+ if(container.hasClassName('last')) {
24
+ row.addClassName('last');
25
+ }
26
+ container.hide();
27
+ } else {
28
+ link.expanded = true;
29
+ link.addClassName('expanded');
30
+ if(container.hasClassName('last')) {
31
+ row.removeClassName('last');
32
+ }
33
+ container.show();
34
+ }
35
+
36
+ return false;
37
+ }
38
+ //]]>
39
+ </script>
40
+ <?php endif; ?>
41
+ <?php $_order = $this->getOrder() ?>
42
+ <h2 class="table-caption"><?php echo $this->__('Items Ordered') ?>
43
+ <?php if ($_order->getTracksCollection()->count()) : ?>
44
+ <span class="separator">|</span> <a href="#" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','top=0,left=0,width=800,height=600,resizable=yes,scrollbars=yes'); return false;" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Track your order')) ?>"><?php echo $this->__('Track your order') ?></a>
45
+ <?php endif; ?>
46
+ </h2>
47
+
48
+ <?php echo $this->getChildHtml('order_items') ?>
49
+
50
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order', $_order) && $_order->getGiftMessageId()): ?>
51
+ <div class="order-additional order-gift-message">
52
+ <h2 class="sub-title"><?php echo $this->__('Gift Message for This Order') ?></h2>
53
+ <?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_order); ?>
54
+ <dl class="gift-message">
55
+ <dt><strong><?php echo $this->__('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
56
+ <dt><strong><?php echo $this->__('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
57
+ <dd><?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_order) ?></dd>
58
+ </dl>
59
+ </div>
60
+ <?php endif; ?>
61
+ <?php $_history = $this->getOrder()->getVisibleStatusHistory() ?>
62
+ <?php if (count($_history)): ?>
63
+ <div class="order-additional order-comments">
64
+ <h2 class="sub-title"><?php echo $this->__('About Your Order') ?></h2>
65
+ <dl class="order-about">
66
+ <?php foreach ($_history as $_historyItem): ?>
67
+ <dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
68
+ <dd><?php echo $this->escapeHtml($_historyItem->getComment()) ?></dd>
69
+ <?php endforeach; ?>
70
+ </dl>
71
+ </div>
72
+ <?php endif; ?>
73
+ <div class="buttons-set">
74
+ <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->getBackTitle() ?></a></p>
75
+ </div>
76
+ </div>
77
+
app/design/frontend/rwd/default/template/ordercomment/checkout/test.phtml~ ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <?php
2
+ exit('21');
3
+ ?>
app/design/frontend/rwd/default/template/ordercomment/sales/order/orderhistorycomment.phtml ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $_order = $this->getOrder() ?>
2
+ <?php
3
+ //#19494 works to display ordercomments
4
+ echo '<dl class="order-info">';
5
+ echo '<dt>'.$this->__('Order Comments :').'</dt>';
6
+ echo '<dd>'.Mage::helper('ordercomment')->getordercomments($_order->getEntityId()).'</dd>';
7
+ echo '</dl>';
8
+ //#19494 works to display ordercomments
9
+ ?>
10
+
11
+ <div class="order-items order-details">
12
+ <?php if ($this->helper('giftmessage/message')->getIsMessagesAvailable('items', $this->getOrder())): ?>
13
+ <script type="text/javascript">
14
+ //<![CDATA[
15
+ function giftMessageToogle(giftMessageIdentifier)
16
+ {
17
+ var link = $('order-item-gift-message-link-'+giftMessageIdentifier);
18
+ var container = $('order-item-gift-message-'+giftMessageIdentifier);
19
+ var row = $('order-item-row-'+giftMessageIdentifier);
20
+ if(link.expanded) {
21
+ link.expanded = false;
22
+ link.removeClassName('expanded');
23
+ if(container.hasClassName('last')) {
24
+ row.addClassName('last');
25
+ }
26
+ container.hide();
27
+ } else {
28
+ link.expanded = true;
29
+ link.addClassName('expanded');
30
+ if(container.hasClassName('last')) {
31
+ row.removeClassName('last');
32
+ }
33
+ container.show();
34
+ }
35
+
36
+ return false;
37
+ }
38
+ //]]>
39
+ </script>
40
+ <?php endif; ?>
41
+ <?php $_order = $this->getOrder() ?>
42
+ <h2 class="table-caption"><?php echo $this->__('Items Ordered') ?>
43
+ <?php if ($_order->getTracksCollection()->count()) : ?>
44
+ <span class="separator">|</span> <a href="#" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','top=0,left=0,width=800,height=600,resizable=yes,scrollbars=yes'); return false;" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Track your order')) ?>"><?php echo $this->__('Track your order') ?></a>
45
+ <?php endif; ?>
46
+ </h2>
47
+
48
+ <?php echo $this->getChildHtml('order_items') ?>
49
+
50
+ <?php if($this->helper('giftmessage/message')->getIsMessagesAvailable('order', $_order) && $_order->getGiftMessageId()): ?>
51
+ <div class="order-additional order-gift-message">
52
+ <h2 class="sub-title"><?php echo $this->__('Gift Message for This Order') ?></h2>
53
+ <?php $_giftMessage=$this->helper('giftmessage/message')->getGiftMessageForEntity($_order); ?>
54
+ <dl class="gift-message">
55
+ <dt><strong><?php echo $this->__('From:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getSender()) ?></dt>
56
+ <dt><strong><?php echo $this->__('To:') ?></strong> <?php echo $this->escapeHtml($_giftMessage->getRecipient()) ?></dt>
57
+ <dd><?php echo $this->helper('giftmessage/message')->getEscapedGiftMessage($_order) ?></dd>
58
+ </dl>
59
+ </div>
60
+ <?php endif; ?>
61
+ <?php $_history = $this->getOrder()->getVisibleStatusHistory() ?>
62
+ <?php if (count($_history)): ?>
63
+ <div class="order-additional order-comments">
64
+ <h2 class="sub-title"><?php echo $this->__('About Your Order') ?></h2>
65
+ <dl class="order-about">
66
+ <?php foreach ($_history as $_historyItem): ?>
67
+ <dt><?php echo $this->formatDate($_historyItem->getCreatedAtStoreDate(), 'medium', true) ?></dt>
68
+ <dd><?php echo $this->escapeHtml($_historyItem->getComment()) ?></dd>
69
+ <?php endforeach; ?>
70
+ </dl>
71
+ </div>
72
+ <?php endif; ?>
73
+ <div class="buttons-set">
74
+ <p class="back-link"><a href="<?php echo $this->getBackUrl() ?>"><small>&laquo; </small><?php echo $this->getBackTitle() ?></a></p>
75
+ </div>
76
+ </div>
77
+
package.xml CHANGED
@@ -1,7 +1,7 @@
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>
@@ -9,10 +9,10 @@
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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Ti_OrderComment</name>
4
+ <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
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>magento@titechnologies.in</email></author></authors>
13
+ <date>2016-08-23</date>
14
+ <time>04:13:18</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 name="Order"><file name="View.php" hash="f8420213af0dd257bc77554baee8ed0c"/></dir></dir><dir name="Helper"><file name="Data.php" hash="e7f013a2fb168e337e7b379f175bad74"/></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="fa7998ec812b4bbd086516423e8dbb4f"/><file name="system.xml" hash="d656f6fe0b273fc3778dc6ce27b5cea9"/></dir></dir></dir></target><target name="mage"><dir name="app"><dir name="design"><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 name="sales"><dir name="order"><file name="orderhistorycomment.phtml" hash="7bc29fd9c6f171d438b1ba08203e4a7b"/></dir></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"/><file name="test.phtml~" hash="99e06c7a6f5c5071aef19e0932638644"/></dir><dir name="sales"><dir name="order"><file name="orderhistorycomment.phtml" hash="7bc29fd9c6f171d438b1ba08203e4a7b"/></dir></dir></dir></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>