【问题标题】:add attribute in product information -> Inventory tab在产品信息中添加属性 -> 库存选项卡
【发布时间】:2011-07-02 01:28:28
【问题描述】:

嘿,我刚刚意识到在 ADMIN 中向表单产品添加属性是多么容易,而且它工作得很好。 因此,与为 General、Prices、Meta Information、Images、Recurring Profiles、Design 和更多信息设置属性类似,我如何向 Inventory 表单添加属性?

提前感谢您的帮助。

【问题讨论】:

    标签: magento product inventory setattribute


    【解决方案1】:

    不幸的是,Inventory 表单不像其他表单那样是动态的,您不能只向该表单添加属性。

    如果你擅长 Magento 编程,那么你可以玩它的块: app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Inventory.php

    并使用它的模板: app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml

    【讨论】:

    • 由于为我指明了正确的方向,它可以完美运行 :)
    • @neil 我们不能只使用观察者,在渲染之前将其添加到选项卡中吗?
    【解决方案2】:

    对我来说(在 Magento v 1.3.2.4 中)以通常的方式创建属性(目录>属性>管理属性)在这种情况下不起作用,因为该属性的值没有被保存。为了能够保存它,我必须在数据库表“cataloginventory_stock_item”中创建这个属性。

    只有这样,每个产品的值才会被保存。

    【讨论】:

      猜你喜欢
      • 2018-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-14
      • 2018-10-06
      • 2016-10-14
      • 1970-01-01
      相关资源
      最近更新 更多