No Comments

Extended cancel order controller results in 404 error

Apply discount only if all subproducts of group prodcuct in cart
how do get store in magento2?

I have created a custom sales order cancel module.In that module I am extending the order cancellation function. Through admin panel when I am canceling any orders it shows a 404 error.

This is my code:

config.xml

<config>
    <modules>
        <Test_Order>
            <version>0.0.1</version>
    </Test_Order>
    </modules>
    <frontend>
        <routers>

            <order>
                <use>standard</use>
                <args>
                    <module>Test_Order</module>
                    <frontName>order</frontName>
                </args>
            </order>
        </routers>
    </frontend>
    <global>
        <rewrite>
            <test_order_order>
                <from><![CDATA[#^/admin/sales_order/cancel/#]]></from>
                <to>/order/order/cancel/</to>
            </test_order_order>
        </rewrite>
    </global>
</config>

OrderController.php

require_once 'Mage/Adminhtml/controllers/Sales/OrderController.php';
class Test_Order_OrderController extends Mage_Adminhtml_Sales_OrderController{
 public function cancelAction()
 {
     //my code..
}
}

Related Posts

Apply discount only if all subproducts of group prodcuct in cart
how do get store in magento2?

Be the first to post a comment.

Add a comment