Customer_Cancel_Order_From_My_Account - Version 1.0.0

Version Notes

The first Version of customer cancel order from my account.

Download this release

Release Info

Developer Commerce Bees
Extension Customer_Cancel_Order_From_My_Account
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

CommerceBees_OrderCancel_MyAccount_Extension_Guide_V1.0.pdf ADDED
Binary file
app/code/local/Ameex/Cancelorder/controllers/IndexController.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Ameex_Cancelorder_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function cancelAction ()
5
+ {
6
+ $params = $this->getRequest()->getParams();
7
+ $orderId=$params['id'];
8
+ $order = Mage::getModel('sales/order')->load($orderId);
9
+ $order_status=$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->save();
10
+ Mage::getSingleton('core/session')->setSuccessmsg('<div class="success-msg">your order has been canceled</div>');
11
+ $this->_redirectReferer();
12
+ }
13
+ }
app/code/local/Ameex/Cancelorder/etc/config.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ameex_Cancelorder>
5
+ <version>1.0.0</version>
6
+ </Ameex_Cancelorder>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <ameex_cancelorder>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Ameex_Cancelorder</module>
14
+ <frontName>cancelorder</frontName>
15
+ </args>
16
+ </ameex_cancelorder>
17
+ </routers>
18
+ </frontend>
19
+ </config>
app/design/frontend/default/default/template/sales/order/history.phtml ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
+ */
26
+ ?>
27
+ <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
28
+ <?php echo Mage::getSingleton('core/session')->getSuccessmsg();?>
29
+ <?php Mage::getSingleton('core/session')->unsSuccessmsg();?>
30
+ <?php $_orders = $this->getOrders(); ?>
31
+ <div class="page-title">
32
+ <h1><?php echo $this->__('My Orders') ?></h1>
33
+ </div>
34
+ <?php echo $this->getPagerHtml(); ?>
35
+ <?php if($_orders->getSize()): ?>
36
+ <table class="data-table" id="my-orders-table">
37
+ <col width="1" />
38
+ <col width="1" />
39
+ <col />
40
+ <col width="1" />
41
+ <col width="1" />
42
+ <col width="1" />
43
+ <thead>
44
+ <tr>
45
+ <th><?php echo $this->__('Order #') ?></th>
46
+ <th><?php echo $this->__('Date') ?></th>
47
+ <th><?php echo $this->__('Ship To') ?></th>
48
+ <th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th>
49
+ <th><span class="nobr"><?php echo $this->__('Order Status') ?></span></th>
50
+ <th>&nbsp;</th>
51
+ </tr>
52
+ </thead>
53
+ <tbody>
54
+ <?php $_odd = ''; ?>
55
+ <?php foreach ($_orders as $_order): ?>
56
+ <?php $orderid=$_order->getId()?>
57
+ <tr>
58
+ <td><?php echo $_order->getRealOrderId() ?></td>
59
+ <td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td>
60
+ <td><?php echo $_order->getShippingAddress() ? $this->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?></td>
61
+ <td><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
62
+ <td><em><?php echo $_order->getStatusLabel() ?></em></td>
63
+ <td class="a-center">
64
+ <span class="nobr"><a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?></a>
65
+ <?php /*<span class="separator">|</span><a href="<?php echo $this->getTrackUrl($_order) ?>"><?php echo $this->__('Track Order') ?></a>&nbsp;*/ ?>
66
+ <?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?>
67
+ <span class="separator">|</span> <a href="<?php echo $this->getReorderUrl($_order) ?>" class="link-reorder"><?php echo $this->__('Reorder') ?></a>
68
+ <?php $status_lbl = $_order->getStatusLabel(); ?>
69
+ <?php if($status_lbl=="Pending"):?>
70
+ <span class="separator"></span> <a href="<?php echo $this->getBaseUrl() ?>cancelorder/index/cancel/id/<?php echo $orderid ?>" class="link-cancel"><?php echo $this->__('Cancel') ?></a>
71
+ <?php else:?>
72
+ <span class="decancel"><span id="decancel" href="" class="link-cancel-p"><?php echo $this->__('Cancellation not available') ?></span></span>
73
+ <?php endif;?>
74
+ <?php endif ?>
75
+ </span>
76
+ </td>
77
+ </tr>
78
+ <?php endforeach; ?>
79
+ </tbody>
80
+ </table>
81
+ <p class="cancel_notify" style="color:red;">Order cancellation option available only if the order status is pending</p>
82
+ <script type="text/javascript">decorateTable('my-orders-table');</script>
83
+ <?php echo $this->getPagerHtml(); ?>
84
+ <?php else: ?>
85
+ <p><?php echo $this->__('You have placed no orders.'); ?></p>
86
+ <?php endif ?>
app/etc/modules/Ameex_Cancelorder.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Ameex_Cancelorder>
5
+ <active>true</active>
6
+ <codePool>local</codePool>
7
+ </Ameex_Cancelorder>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Customer_Cancel_Order_From_My_Account</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="https://www.gnu.org/copyleft/gpl.html">GPL v3</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Customer order cancel from my account is an open-source Magento module developed by Commerce Bees. The primary focus of the module is used to cancel the order from my account page by the users.</summary>
10
+ <description>Order can cancel by the user from the my accout section under my order tab.&#xD;
11
+ Order cancellation is possible only for the pending order status.&#xD;
12
+ Once order status moved from pending to any other status it will show order cancellation not available.&#xD;
13
+ Notification will shown to the user in the my order page. </description>
14
+ <notes>The first Version of customer cancel order from my account.</notes>
15
+ <authors><author><name>commercebees</name><user>commercebees</user><email>support@commercebees.com</email></author></authors>
16
+ <date>2015-01-31</date>
17
+ <time>14:18:12</time>
18
+ <contents><target name="magelocal"><dir name="Ameex"><dir name="Cancelorder"><dir name="controllers"><file name="IndexController.php" hash="9096094739a4cdcd01d657e94bbb55b7"/></dir><dir name="etc"><file name="config.xml" hash="36568ee441092819e8978a3476c19cf4"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="sales"><dir name="order"><file name="history.phtml" hash="39ca10182b59ceada5fb9f91b3a8e7f0"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="."><file name="CommerceBees_OrderCancel_MyAccount_Extension_Guide_V1.0.pdf" hash="2b0443f9d56f81ebbfdcd8ef7db114ed"/></dir></target><target name="mageetc"><dir name="modules"><file name="Ameex_Cancelorder.xml" hash="1cb1731d5fb77073f3f60a24a1049341"/></dir></target></contents>
19
+ <compatible/>
20
+ <dependencies><required><php><min>5.2.0</min><max>7.0.0</max></php></required></dependencies>
21
+ </package>