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

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax