Cdr_OrderComment - Version 0.0.3

Version Notes

Added Order Comments to Onepage Checkout & Multi-shipping Checkout.

Order comment is displayed within the Orders Grid and orders comment history

Download this release

Release Info

Developer Cdr
Extension Cdr_OrderComment
Version 0.0.3
Comparing to
See all releases


Code changes from version 0.0.2 to 0.0.3

app/code/community/Cdr/OrderComment/Model/Observer.php CHANGED
@@ -10,9 +10,12 @@ class Cdr_OrderComment_Model_Observer
10
  */
11
  public function saveOrderComment($observer)
12
  {
 
 
13
  if (Mage::getStoreConfigFlag('ordercomment/settings/active')) {
14
  $comment = trim(Mage::app()->getRequest()->getPost('cdr_ordercomment'));
15
 
 
16
  if (!empty($comment)) {
17
  $limit = (int) Mage::getStoreConfig('ordercomment/settings/limit');
18
  if (is_integer($limit) && $limit > 0 && strlen($comment) > $limit)
10
  */
11
  public function saveOrderComment($observer)
12
  {
13
+ Mage::log('save Order', null, 'filename.log');
14
+ Mage::log('active = '.var_export(Mage::getStoreConfigFlag('ordercomment/settings/active'), true), null, 'filename.log');
15
  if (Mage::getStoreConfigFlag('ordercomment/settings/active')) {
16
  $comment = trim(Mage::app()->getRequest()->getPost('cdr_ordercomment'));
17
 
18
+ Mage::log('Order Comment = '.$comment, null, 'filename.log');
19
  if (!empty($comment)) {
20
  $limit = (int) Mage::getStoreConfig('ordercomment/settings/limit');
21
  if (is_integer($limit) && $limit > 0 && strlen($comment) > $limit)
app/code/community/Cdr/OrderComment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Cdr_OrderComment>
5
- <version>0.0.2</version>
6
  </Cdr_OrderComment>
7
  </modules>
8
  <global>
@@ -34,7 +34,7 @@
34
  <layout>
35
  <updates>
36
  <ordercomment>
37
- <file>cdr_ordercomment.xml</file>
38
  </ordercomment>
39
  </updates>
40
  </layout>
@@ -43,7 +43,7 @@
43
  <layout>
44
  <updates>
45
  <ordercomment>
46
- <file>cdr_ordercomment.xml</file>
47
  </ordercomment>
48
  </updates>
49
  </layout>
2
  <config>
3
  <modules>
4
  <Cdr_OrderComment>
5
+ <version>0.0.3</version>
6
  </Cdr_OrderComment>
7
  </modules>
8
  <global>
34
  <layout>
35
  <updates>
36
  <ordercomment>
37
+ <file>cdr/cdr_ordercomment.xml</file>
38
  </ordercomment>
39
  </updates>
40
  </layout>
43
  <layout>
44
  <updates>
45
  <ordercomment>
46
+ <file>cdr/cdr_ordercomment.xml</file>
47
  </ordercomment>
48
  </updates>
49
  </layout>
app/design/adminhtml/default/default/layout/cdr/cdr_ordercomment.xml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <add_order_grid_column_handle>
4
+ <reference name="sales_order.grid">
5
+ <action method="addColumnAfter" ifconfig="ordercomment/settings/grid">
6
+ <columnId>cdr_order_comment</columnId>
7
+ <arguments module="sales" translate="header">
8
+ <header>Order Comment</header>
9
+ <index>cdr_order_comment</index>
10
+ <type>text</type>
11
+ <filter_index>main_table.cdr_order_comment</filter_index>
12
+ </arguments>
13
+ <after>status</after>
14
+ </action>
15
+ </reference>
16
+ </add_order_grid_column_handle>
17
+
18
+ <adminhtml_sales_order_grid>
19
+ <update handle="add_order_grid_column_handle" />
20
+ </adminhtml_sales_order_grid>
21
+
22
+ <adminhtml_sales_order_index>
23
+ <update handle="add_order_grid_column_handle" />
24
+ </adminhtml_sales_order_index>
25
+ </layout>
app/design/frontend/base/default/layout/{cdr_ordercomment.xml → cdr/cdr_ordercomment.xml} RENAMED
File without changes
app/design/frontend/base/default/template/cdr/ordercomment/onepage/review/commentfield.phtml CHANGED
@@ -1,18 +1,19 @@
1
  <?php /* @var $this Cdr_OrderComment_Block_Checkout_Onepage_Review_Commentfield */ ?>
2
 
3
  <?php if ($this->isActive()) : ?>
4
- <div id="cdr_ordercomment-form">
 
5
  <div class="buttons-set">
6
  <ul class="form-list">
7
  <li>
8
  <fieldset>
9
  <ul>
10
  <li class="wide">
11
- <label for="cdr_ordercomment"><?php echo Mage::helper('ordercomment')->__('CDR Order Comment') ?></label>
12
  <div class="input-box">
13
  <textarea id="cdr_ordercomment" class="input-text validation-passed" name="cdr_ordercomment" title="<?php echo $this->__('CDR Order Comment') ?>" rows="5" cols="10" maxlength="<?php echo $this->getMaxCommentSize(); ?>"></textarea>
14
  <?php if ($this->limitTextArea()): ?>
15
- <p><span id="cdr_ordercomment-max-len"><?php echo $this->getMaxCommentSize(); ?></span> <?php echo Mage::helper('ordercomment')->__('Chars Remaining'); ?></p>
16
  <?php endif; ?>
17
  </div>
18
  </li>
@@ -21,10 +22,12 @@
21
  </li>
22
  </ul>
23
  </div>
24
- </div>
25
  <script>
26
  if ($('checkout-agreements'))
27
  $('checkout-agreements').appendChild($('cdr_ordercomment-form'));
 
 
28
 
29
  <?php if ($this->limitTextArea()): ?>
30
  $('cdr_ordercomment').observe('keyup', function(event) {
1
  <?php /* @var $this Cdr_OrderComment_Block_Checkout_Onepage_Review_Commentfield */ ?>
2
 
3
  <?php if ($this->isActive()) : ?>
4
+
5
+ <form action="" id="cdr_ordercomment-form" onsubmit="return false;">
6
  <div class="buttons-set">
7
  <ul class="form-list">
8
  <li>
9
  <fieldset>
10
  <ul>
11
  <li class="wide">
12
+ <label for="cdr_ordercomment"><?php echo $this->__('Order Comment') ?></label>
13
  <div class="input-box">
14
  <textarea id="cdr_ordercomment" class="input-text validation-passed" name="cdr_ordercomment" title="<?php echo $this->__('CDR Order Comment') ?>" rows="5" cols="10" maxlength="<?php echo $this->getMaxCommentSize(); ?>"></textarea>
15
  <?php if ($this->limitTextArea()): ?>
16
+ <p><span id="cdr_ordercomment-max-len"><?php echo $this->getMaxCommentSize(); ?></span> <?php echo $this->__('Chars Remaining'); ?></p>
17
  <?php endif; ?>
18
  </div>
19
  </li>
22
  </li>
23
  </ul>
24
  </div>
25
+ </form>
26
  <script>
27
  if ($('checkout-agreements'))
28
  $('checkout-agreements').appendChild($('cdr_ordercomment-form'));
29
+ else
30
+ $('cdr_ordercomment-form').id = 'checkout-agreements';
31
 
32
  <?php if ($this->limitTextArea()): ?>
33
  $('cdr_ordercomment').observe('keyup', function(event) {
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cdr_OrderComment</name>
4
- <version>0.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -16,9 +16,9 @@ This means that it will be compatible with any other module that alters the sale
16
  Order comment is displayed within the Orders Grid and orders comment history&#xD;
17
  </notes>
18
  <authors><author><name>Cdr_Software</name><user>PaulKetelle</user><email>paul@ketelle.co.uk</email></author></authors>
19
- <date>2014-02-18</date>
20
- <time>14:50:24</time>
21
- <contents><target name="mageetc"><dir name="modules"><file name="Cdr_OrderComment.xml" hash="9787f0ac2363120a6ed4432833d42428"/></dir></target><target name="magecommunity"><dir name="Cdr"><dir name="OrderComment"><dir><dir name="Block"><dir name="Checkout"><dir name="Onepage"><dir name="Review"><file name="Commentfield.php" hash="d7e95f809fb5bae7e0586fad2d69b9ab"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><file name="Ordercomment.php" hash="4a5b4ca1950038facaacdd78382b22de"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="37da67c151f7da560e7d98084a883821"/></dir><dir name="Model"><file name="Observer.php" hash="f8632302b82651f2a0118a89ee2b8a9a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0d103e251b0e2d2216ba4906bd6ab41c"/><file name="config.xml" hash="065a6c0c3492fae94812222eab88cf54"/><file name="system.xml" hash="ab78872ea76a77c4ccf13e63c273051b"/></dir><dir name="sql"><dir name="ordercomment_setup"><file name="install-0.0.1.php" hash="e14626ce4cfb4962c1397792b6e27cb5"/><file name="upgrade-0.0.1-0.0.2.php" hash="cbff0ca491fb00179cc571965adc654e"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cdr_ordercomment.xml" hash="fb262c270f7dcbe901e6b2a95bc6df85"/></dir><dir name="template"><dir name="cdr"><dir name="ordercomment"><dir><dir name="onepage"><dir name="review"><file name="commentfield.phtml" hash="20baa7497cc46cd800802cf59ef440e2"/></dir></dir><dir name="sales"><dir name="order"><dir name="view"><file name="ordercomment.phtml" hash="5ff233b5996ab70d046c5bbf7c93fc5c"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="cdr"><file name="cdr_ordercomment.xml" hash=""/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Cdr_OrderComment</name>
4
+ <version>0.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
16
  Order comment is displayed within the Orders Grid and orders comment history&#xD;
17
  </notes>
18
  <authors><author><name>Cdr_Software</name><user>PaulKetelle</user><email>paul@ketelle.co.uk</email></author></authors>
19
+ <date>2014-03-04</date>
20
+ <time>17:58:55</time>
21
+ <contents><target name="mageetc"><dir name="modules"><file name="Cdr_OrderComment.xml" hash="9787f0ac2363120a6ed4432833d42428"/></dir></target><target name="magecommunity"><dir name="Cdr"><dir name="OrderComment"><dir><dir name="Block"><dir name="Checkout"><dir name="Onepage"><dir name="Review"><file name="Commentfield.php" hash="d7e95f809fb5bae7e0586fad2d69b9ab"/></dir></dir></dir><dir name="Sales"><dir name="Order"><dir name="View"><file name="Ordercomment.php" hash="4a5b4ca1950038facaacdd78382b22de"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="37da67c151f7da560e7d98084a883821"/></dir><dir name="Model"><file name="Observer.php" hash="88f8537ae1cb6a4b8493991672f6b6e7"/></dir><dir name="etc"><file name="adminhtml.xml" hash="0d103e251b0e2d2216ba4906bd6ab41c"/><file name="config.xml" hash="e54314bbede3afa6cf78f876c3c2d89f"/><file name="system.xml" hash="ab78872ea76a77c4ccf13e63c273051b"/></dir><dir name="sql"><dir name="ordercomment_setup"><file name="install-0.0.1.php" hash="e14626ce4cfb4962c1397792b6e27cb5"/><file name="upgrade-0.0.1-0.0.2.php" hash="cbff0ca491fb00179cc571965adc654e"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="cdr"><file name="cdr_ordercomment.xml" hash="fb262c270f7dcbe901e6b2a95bc6df85"/></dir></dir><dir name="template"><dir name="cdr"><dir name="ordercomment"><dir><dir name="onepage"><dir name="review"><file name="commentfield.phtml" hash="c9c8caad19adb5f52679abdb706aa65c"/></dir></dir><dir name="sales"><dir name="order"><dir name="view"><file name="ordercomment.phtml" hash="5ff233b5996ab70d046c5bbf7c93fc5c"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="cdr"><file name="cdr_ordercomment.xml" hash="491197634248ec0b6f9c78647259ecc8"/></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
24
  </package>