Magento read-only and hidden product attributes

后端 未结 7 1329
迷失自我
迷失自我 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 14:59

    etc\adminhtml\events.xml

        
    
        
          
        
    
    

    Observer\Lock.php

    namespace Vendor\Module\Observer;
     
    class Lock implements \Magento\Framework\Event\ObserverInterface
    {
        public function execute(\Magento\Framework\Event\Observer $observer)
        {
            $event = $observer->getEvent();
            $product = $event->getProduct();
            $product->lockAttribute('attribute_code');
         }
    }
    

提交回复
热议问题