I would like to disable a field in magento admin at default level.

The reason for this is I have built a bespoke stock integration which will overwrite the default values regularly.

I will populate the fields at "store view" level.

Things I have tried:

$installer->updateAttribute('catalog_product', 'name', 'readonly', 1);
$installer->updateAttribute('catalog_product', 'name', 'is_readonly', 1);
$installer->updateAttribute('catalog_product', 'name', 'disabled', 1);
$installer->updateAttribute('catalog_product', 'name', 'is_disabled', 1);

I understand that if this is possible I may not be able to make new products within Magento. I am ok with this due to the fact all sku's should be imported from our stock management.


1 Answer 1


This question / answers pointed me in the right direction:


This function:

public function lockAttributes($observer) {
  $event = $observer->getEvent();
  $product = $event->getProduct();

in this observer:


Then use the product object to find the store id:

$event = $observer->getEvent();
$product = $event->getProduct();
if ($product->getStoreId() == 0) {

This will only disable the attribute at the default store level.

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.