本文介绍了Magento-产品属性在管理中不可见/不可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在代码中(或手动)创建通过管理编辑产品页面不可见(因此不可编辑)的产品属性?以及如何?

(该属性只需要在php模块中使用(保存/加载))

解决方案

是的,有可能.如果在安装脚本中执行此操作,则应将'visible'设置为false:

$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, '<attribute_code>', array(
    ...
    'visible'       => false,
    ...
));

如果您需要直接在db中更改现有属性的属性-转到catalog_eav_attribute表,找到您的属性(通过eav_attribute表中的属性代码查找属性id),并将其is_visible字段设置为0. /p>

Is it possible in code (or manually) to create a Product Attribute that is not visible (and thus not editable) through the administration edit product page? And how?

(The attribute only needs to used (save / load) in php modules)

解决方案

Yes, it is possible. If you doing it in install script - you should set 'visible' to false:

$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, '<attribute_code>', array(
    ...
    'visible'       => false,
    ...
));

If you need change it for existent attribute directly in db - go to catalog_eav_attribute table, find your attribute (look for attribute id by attribute code in eav_attribute table) and set it's is_visible field to 0.

这篇关于Magento-产品属性在管理中不可见/不可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 22:16