Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6150501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:37:22+00:00 2026-05-23T19:37:22+00:00

As far as I understand Magento have various order statuses under global/sales/order/statuses which can

  • 0

As far as I understand Magento have various order statuses under global/sales/order/statuses which can be altered by either copying app/code/core/Mage/Sales/etc/config.xml to local scope or overriding it with your custom module.

There are also global/sales/order/states defined in the same file and as far as I understand states are something like statuses groups. Only states (not statuses) can be set at the order status in magento and statuses are something like states subdivisions. So in administrator interface you can change statuses of a placed order but you can’t change state from the order status drop-down (you can change it by either invoicing the client or canceling the order).

As far as I understand you can easily add a new status to your Magento but can’t add new state as states are somehow hardcoded with the rest or Magento order processing logic. I really hope that I’m wrong.

Please correct me if I’m wrong in any point as these are just my thoughts and it might be quite far from real Magento 1.4.x flow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:37:23+00:00Added an answer on May 23, 2026 at 7:37 pm

    I’m quite sure that ‘state’ is free data, it can be set to ANY value using the setData option on an order instance. So if you write a custom module that can load an order, set data to one of your new ‘states’ and test with what ever custom logic you require.

    $order = Mage::getModel('sales/order')->load(1);
    $order->setData('state','myCustomState');
    $order->setData('status','onCustomState');
    echo $order->getState()
    // Returns myCustomState
    

    its worth bearing in mine that CLOSED/CANCELLED are protected states, so trying to use $order->setState(‘my_state’) will fail on those order, but shouldn’t fail on setData so you can overwrite a closed or cancelled order with this method.

    if you were to overwrite the order model with a custom one you could add your own logic such as isOnCustomState() and allow the order to be handled in any way just by loading by id.

    To add ‘custom logic’ to your order you could do something copy app\code\core\Mage\Sales\Model\Order.php into your local folder, then you can add functions into that model,

    public function isActive(){ if($this->getState() == 'active'){ return true; } else { return false; }
    public function isInActive(){ if($this->getState() == 'deactivated'){ return true; } else { return false; }
    
    public function activate(){
        if(!$this->isActive()){
            $this->setData('state','active');
            $this->setData('status','Active Subscription');
    
            // some custom code to start a recuring payment
    
            return $this;
        }
    }
    
    public function deactiveate(){
        if(!$this->isInActive()){
            $this->setData('state','deactivated');
            $this->sendOrderUpdateEmail(true,'Your subscription has been deactivated.');
    
            // some custom code to stop a recuring payment
    
            return $this;
        }
    }
    

    now you can load an order and set activate or deactivate on that order to fire your custom code,

    $order = Mage::getModel('sales/order')->load(1)->activate();
    

    this code is all untested and just an example of somethings you could try, please don’t just dump this code in your model and expect it to work perfectly. in code\core\Mage\Sales\etc\config.xml in the nodes sales/order/states add

    <activated translate="label">
       <label>Active Subscription</label>
       <statuses>
          <pending default="1"/>
       </statuses>
       <visible_on_front/>
    </activated>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So far I can understand HTML.ActionLink and URL.RouteURL but still trying to absorb where
As far as I understand, due to license reqirements all web applications, which use
As far as I understand, in Scala we can define a function with no
as far as I understand, getters/setters should always make copies, in order to protect
As far as I understand, the IDeserializationCallback interface and the OnDeserialized event can both
I have gotten so far to understand that merge() is an option to copy
as far as I understand a ModelBinder can generate class instances out of routedata/formdata
As far as I understand, main purpose of dependency injection is to have all
I understand so far that in Jquery, with html() function, we can convert HTML
As far as I understand, if I want to get my database under source

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.