【问题标题】:how to update the product description in a specified category?如何更新指定类别的产品描述?
【发布时间】:2013-01-09 17:12:44
【问题描述】:

我想使用以下 sql 代码将具有相同描述的所有产品设置为具有指定类别 id,但是在同一类别下它不会更新具有相同描述的产品。

update catalog_product_entity_text
  set value = "the product's name test hah test."
  where attribute_id = 66 and
        entity_id (select product_id from catalog_category_product
                    where category_id = 40);

谢谢。

【问题讨论】:

  • 您能谈谈所涉及的表吗?例如列名和几行。
  • 您没有收到此查询的错误信息吗?

标签: sql magento magento-1.6


【解决方案1】:

尝试像这样使用“entity_id IN ...”:

update catalog_product_entity_text
  set value = "the product's name test hah test."
  where attribute_id = 66 and
        entity_id IN (select product_id from catalog_category_product
                    where category_id = 40);

【讨论】:

    【解决方案2】:

    您忘记在 entity_id 和选择查询之间写 IN

    我不知道您使用的是哪个版本,但对我来说,short_description 的 attribute_id 是 65,而描述是 64。

    【讨论】:

    • 我加了,还是不行,版本是Magento ver. 1.6.2.0 怎么知道short_description的attribute_id是65
    • 查看数据库表eav_attribute,用attribute_code搜索
    猜你喜欢
    • 2021-07-02
    • 1970-01-01
    • 1970-01-01
    • 2022-09-23
    • 2021-10-09
    • 1970-01-01
    • 2014-11-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多