Magento read-only and hidden product attributes

后端 未结 7 1341
迷失自我
迷失自我 2020-12-16 14:10

I would like to have some Magento product attributes that are not editable from the admin interface and some that are not visible at all in that interface (as a method of st

7条回答
  •  孤城傲影
    2020-12-16 15:06

    I think Aad Mathijssen and Epicurus combined have the best answer to the question, with a little clarification. As Aad points out, catalog_product_load_after is called after every product load and that means on the FrontEnd as well!

    If we are looking to protect attribute fields only in the admin panels, catalog_product_edit_action is the more appropriate choice.

    Your etc/config.xml will then be something like this:

    
      
        
          yourmodule/observers
          lockAttributes
        
      
    
    

提交回复
热议问题