且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 magento 中创建依赖属性

更新时间:2023-11-30 07:55:04

让我假设您说的是产品属性,直截了当地说.

Let me assume you mean product attributes by saying attributes plainly.

要回答您的问题,无法在管理属性"下直接或直接创建相关产品属性.但是您可以通过创建可配置产品使您的属性相互依赖.

假设您有 2 种颜色(黑色和蓝色)和 2 种尺寸(L、XL),并且您想让颜色取决于尺寸.

Lets say you have 2 colors (black and blue) and 2 sizes (L,XL) and you want to make your colors depend on sizes.

  1. 首先在管理属性下创建 2 个属性大小和类型下拉列表,然后创建属性选项和值.并将其分配给正确的属性集.

  1. At first create 2 attributes size and color of type dropdown under Manage attributes and create the attribute options and values. and Assign it to the right attribute set.

现在创建简单的产品,假设产品 A 的尺寸为 L,颜色为黑色,产品 B 的颜色为蓝色,尺寸为 XL.

Now create the simple products , lets say product A with size L and color Black and product B with color Blue and size XL.

现在创建一个可配置的产品,比如说 AB,并将这两个简单的产品 A 和 B 关联起来.保存产品.

Now create a configurable product lets say AB and associate these two simple products A and B. Save the product.

如果客户打开产品 AB 并且他们选择尺寸 L,他们只能找到黑色.这样您就可以让您的产品属性相互依赖.

if the customer opens the product AB and if they choose size L they can find only color Black. This is how you can make your product attributes dependent on each other.