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 9213925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:51:42+00:00 2026-06-18T01:51:42+00:00

I am trying to manually change order status to complete at a certain point

  • 0

I am trying to manually change order status to complete at a certain point in my code. This is what I have so far:

$order = Mage::getModel('sales/order')->load($_GET['orderid']);
$order->setState(Mage_Sales_Model_Order::STATE_COMPLETE, true, 'Pedido completado exitosamente.', true, false)->save();

When I do that I get the error:

The Order state 'complete' must not be set manually.

Ok so I tried this:

$order = Mage::getModel('sales/order')->load($_GET['orderid']);
$order->setStatus("complete");
$order->save();

When I do that I get the error:

Call to a member function getMethodInstance() on a non-object

So how can I manually set the order status to complete.

I tried with the first one commenting out the following lines in Sales/Order.php:

if ($shouldProtectState) {
            if ($this->isStateProtected($state)) {
                Mage::throwException(
                    Mage::helper('sales')->__('The Order State "%s" must not be set manually.', $state)
                );
            }
        }

But no go, I still get the not setting to complete error above.

I am using Magento 1.7.0.2.

  • 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-06-18T01:51:43+00:00Added an answer on June 18, 2026 at 1:51 am

    First get the order ID like you already did:

    $order = Mage::getModel('sales/order')->load($_GET['orderid']);
    

    and then,

    Try

    $order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);
    

    OR

    $order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);
    $order->save();
    

    You can’t set Order state to COMPLETE or CLOSED manually with setState() method AFAIK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spinner and I am trying to populate it manually in the
rails 2.3.4, sqlite3 I'm trying this Production.find(:all, :conditions => ["time > ?", start_time.utc], :order
I'm trying to change manually the content of a div using jQuery, depending on
I'm trying to create a draggable list to change the order some pictures are
I'm trying to manually manage some geometry (spatial) columns in a rails model. When
Following a MSDN web page, I am trying to manually run mstest within my
Im using sql server 2012 and its replication feature. Here im trying to manually
Trying to figure out how to install rails plugins manually on windows so I
I'm trying to read an ontology manually designed on Protege 4 to update It
I'm trying to remove selected item from ComboBox Collection: Items are added manually, as

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.