I'm trying to loop through a lot of order ids and fetching the order data but performing a clearInstance() on an order model variable doesn't seem to clear the data and I keep getting the same data. Has anyone else experienced this? For now I'm having to just use this which uses up way too much memory.

  • Can you please add the code you have tried before?
    – sv3n
    Commented May 15, 2018 at 18:17

1 Answer 1


You need to unset variable in which you are storing the data of order.

Also you need to check you are passing correct value in $order['order_id']

Reference :http://php.net/manual/en/function.unset.php


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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