在 Magento 中,有没有办法在创建后从可配置产品中删除属性?

发布于 2024-10-21 10:15:51 字数 233 浏览 4 评论 0原文

在 Magento 中,我已经创建了一堆可配置产品,现在有一个客户改变了主意并想要删除其中一个属性。我很难弄清楚如何执行此操作,因为我不断收到一条错误消息:

该属性用于可配置的 产品。您无法将其从中删除 属性集。

我尝试进入该属性并将用于创建可配置产品从“是”更改为“否”,但在尝试从现有产品中删除属性时似乎没有任何作用

In Magento, I have have a bunch of configurable products already created and now have a client that has changed their mind and wants to remove one of the attributes. I'm having a hard time figuring out how to do this b/c I keep getting an error message saying:

This attribute is used in configurable
products. You cannot remove it from
the attribute set.

I have tried going into the attribute and changing Use to Create Configurable Product from "yes" to "no", but that didn't seem to do anything when trying to remove attribute from existing products

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

凌乱心跳 2024-10-28 10:15:51

要从所有可配置产品中删除一个超级产品属性(如它们的名称),您可以在数据库中执行以下 SQL 查询:

DELETE FROM catalog_product_super_attribute
WHERE attribute_id = <id>

catalog_product_super_attribute 将产品链接到超级产品属性。您可以在其中添加和删除已创建的可配置产品的属性。

To remove one super product attribute (as they are called) from all configurable products, you could execute this SQL query in the database:

DELETE FROM catalog_product_super_attribute
WHERE attribute_id = <id>

The table catalog_product_super_attribute links products to super product attributes. You can add and remove attributes to created configurable products there.

瀟灑尐姊 2024-10-28 10:15:51

您似乎首先尝试从属性集中删除该属性,但您需要从可配置产品中删除它,然后再从属性集中删除。打开每个可配置产品,转到“关联产品”选项卡并删除不需要的属性(和链接的产品)。保存每个产品,然后尝试从集合中删除该属性。

It seems like you're trying to remove the attribute from the attribute set first, but you need to remove it from the configurable products, then the attribute set. Open each configurable product, go to the Associated Products tab and remove the attribute (and linked products) that is not required. Save each product and then try removing the attribute from the set.

不念旧人 2024-10-28 10:15:51

只需使用 phpmyadmin 并连接到您的数据库。
查找 eav_attribute 表。
删除你想要的属性。

Simply use phpmyadmin and connect to your database.
Look for the eav_attribute table.
Delete the attribute you want.

十秒萌定你 2024-10-28 10:15:51

基于 Christian Davén 的答案,您可以使用以下命令根据 attribute_code 名称而不是 attribute_id 本身进行删除,只是为了确保您引用了正确的 ID:

DELETE FROM `catalog_product_super_attribute`
WHERE `attribute_id` IN (
    SELECT `attribute_id` FROM `eav_attribute`
    WHERE `attribute_code` = "attribute"
)

Building on Christian Davén's answer, you could use the following to delete based on the attribute_code name instead of the attribute_id itself, just to be sure that you are referencing the right ID:

DELETE FROM `catalog_product_super_attribute`
WHERE `attribute_id` IN (
    SELECT `attribute_id` FROM `eav_attribute`
    WHERE `attribute_code` = "attribute"
)
吻安 2024-10-28 10:15:51

不幸的是,这在标准 Magento 后端是不可能的。
因此,您必须查看 SQL 解决方案(我对这些不熟悉)。

Unfortunately, this is not possible from the standard Magento backend.
As such, you have to look at SQL solutions (I'm not familair with these).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文