Magento restrict admin order grid by website for user

Posted on March 25, 2014

So this is a real quick and easy way to restrict all orders from a websites or store views in your magento for a selected user role.

find this file in your magento install: /app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

i do recommend you copy and edit a version of this file over to your local code folder.

now around line 59 find this line

and below add this code

change these parts to your requirments:

USER_ROLE_HERE = the role name of your user permissions role ( in magento: System > Permissions > Roles )

STORE_ID_HERE = The Store ID of the store view you want them to only have access to. you can get this by going to in magento: System > Manage Stores > click on your store view name and then look in the browser url for something like /store_id/9/   where the number = your store id.

if you want to change it to a website and not just a store simply change the filter from store_id to website_id and get your website ID via the same method above but instead of clicking on your store view name, click on your website name