【问题标题】:Display products against attributes in magento根据 magento 中的属性显示产品
【发布时间】:2013-03-04 11:39:36
【问题描述】:

我正在使用 magento 开发自定义模块。

我创建了两个新属性(组合框)make 和 location。之后,我使用针对特定产品的自定义代码为这些属性添加值。就像我添加“索尼”和位置是“澳大利亚”针对产品 1(1 是产品的 ID)。

现在在管理方面,我想显示这个产品的属性值,比如 make 是 Sony,location 是 Australia,product 是 1。

我发现了一些表,其中这些值是链接的,例如 (catalog_product_entity_int,eav_attribute,eav_attribute_option,eav_attribute_option_value),但我无法查询此类记录。我要显示数据的页面有属性 id 和属性代码。

谁能知道我是怎么弄出来的?

【问题讨论】:

    标签: magento magento-1.7


    【解决方案1】:

    非常简单的家伙。

    在自定义模块网格的 _prepareCollection() 方法中

    加载产品集合并选择这两个属性...如果需要通过这两个属性进行过滤,那就这样做吧。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-15
      • 2012-01-26
      • 1970-01-01
      • 2015-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多