I want to allow customers to cancel their pending orders in "My Account" section.

I tried this tutorial, but it doesn't show 'cancel order' link in customer "My Orders" page.

How can I do this in Magento ?

Any assistance will be helpful.


Hope you know how to create the method in controller and how to access that method on front-end.

Create the simple link in my account page and create the method in your controller and and write the below code in your method that order Status Will be changed.

$orderId = YOUR_ORDER_ID;
$order = Mage::getModel(‘sales/order’)

$order->setState(Mage_Sales_Model_Order::STATE_CANCELED, true)->save();
  • I didn't getting you what you said. – Keyul Shah Feb 4 '14 at 9:16
  • I meant, I created "cancel order" section for customers using your code. – Balaji Kandasamy Feb 4 '14 at 10:35
  • hmm that's grate – Keyul Shah Feb 4 '14 at 15:23
  • wouldn't this allow the user to edit the URL to contain a different order ID though? Assuming you're using url params? Meaning a user can cancel other peoples orders via the url – Ricky Odin Matthews Nov 26 '15 at 9:50

I realise that it is generally frowned upon to simply recommend an extension as a solution, but the following extension is free and I have been using it on without any problems (despite it being listed as only compatible with 1.4 and 1.5)


  • Yes I tried this extension also. But I have not seen any link to cancel order in "Order History" Page. – Balaji Kandasamy Feb 1 '14 at 4:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.