I'm trying to establish whether it is possible to differentiate between orders placed in the frontend (by the customer) and the backend (by an administrator).

I read this post on SO:

Differentiating Backend vs. Frontend Purchases in Magento

Which mainly highlights the fact that you used to be able to check the store_id field, but this does not hold true for the latest versions of Magento.

The other thing which it mentions is that when looking at an order via the backend, if it was indeed placed by a customer, you will see a field titled Placed from IP, which is missing if it was placed by an administrator.

I can't seem to find anything related to IP addresses via the sales_flat_order table.

Any ideas?

2 Answers 2


There is a field remote_ip on the table sales_flat_order, that appears to be null from the admin and the ip of the customer from the front end.

It was added in Magento 1.6 so if you are using version 1.7 you should be safe here.

It is set in app/code/core/Mage/Checkout/Model/Session.php on the quote and copied across.

  • Ah, can't believe I missed that! Exactly what I was looking for. I was searching for something along the lines of 'ip address'
    – Moose
    Mar 30, 2014 at 12:37
  • This didn't work for me. Sometimes $order->getRemoteIp() isn't set for front end orders. Not sure why. I am on Magento
    – Willster
    Mar 10, 2020 at 10:13

This worked for me:

if (Mage::app()->getStore()->isAdmin()) {
    // your code here

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.