1

I have followed this guide :

http://islamic-posters.aceph.me/post/19049000412/magento-custom-order-state

and created a new order state and status called "delivered" in my admin. Basically these are used to track which shipments are getting delivered and which are returned. As the shipments get delivered I want to mark them as delivered in the system so that I can keep track. This happens after the order has been invoiced and shipped.

Now the problem is when I try to set the state as "delivered" it keeps going back to "complete". How do I fix this ? How do I change the state to delivered after it has been completed.

I am attaching a screenshot of what happens : http://awesomescreenshot.com/0913gf6981

  • Are you distinguishing between 'shipped' and 'delivered' i.e. the parcel is on it's way vs you have had confirmation the customer has taken delivery of the parcel? – Jonathan Hussey Sep 9 '14 at 14:19
  • Yes. I need to distinguish between shipped and delivery. So for now I have created a new status called "shipped" and assigned it to "complete" order state. Once the shipped item is delivered and I get confirmation, I need to mark it as "Delivered" – aradhya Sep 9 '14 at 18:54
1

I think that's because the delivered status is set after the order is shipped, which makes the order complete. To remove this behavior, you need to comment or remove this line in app/code/core/Mage/Sales/Model/Order.php:

$this->_setState(self::STATE_COMPLETE, true, '', $userNotification);

You can find it in the function _checkState(), which is called just before the order is saved.

Having said that, it is a big NO-NO to modify core file directly. You have to bear all the risks that come with it.

  • @aradhya BTW, the guide that you followed is really an ugly hack. But if it works for you, stick with it. – kiatng Nov 7 '14 at 14:22

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.