2

I am totally new to magento and I have orderid. Now I have to check whether it exists or not.I am not aware of what class and method should be used for this.

Thanks In Advance...

1 Answer 1

2

If you have the order entity id you can try the following:

$order = Mage::getModel('sales/order')->load($orderId);
if ($order->getIncrementId()) {
    // order exists
}

If you have the order increment id you'll need to use the following code:

$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
if ($order->getOrderId()) {
    // order exists
}

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.