gpt4 book ai didi

mysql - 通过MySQL查询批量更新简单产品 "status"

转载 作者:可可西里 更新时间:2023-11-01 07:01:41 25 4
gpt4 key购买 nike

我刚刚将超过 12,000 种产品导入到我的 Magento 目录中。

问题是,产品带有未定义的“状态”字段,如果我想在前端商店中使用它们,我需要手动将它们设置为“已启用”。手动执行此操作需要数小时。

你知道这个设置是在数据库的什么地方定义的吗?您知道自动执行此操作的查询吗(我想将所有产品设置为“已启用”)。

最佳答案

# First find the ID of the product status attribute in the EAV table:
SELECT * FROM eav_attribute where entity_type_id = 4 AND attribute_code = 'status'

# Then use that status attribute ID ($id) while querying the product entity table:
UPDATE catalog_product_entity_int SET value = 1 WHERE attribute_id = $id
  • 1 - 已启用
  • 2 - 残疾

关于mysql - 通过MySQL查询批量更新简单产品 "status",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7190281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com