Why do Magento configurable products have a SKU
I am about to create a开发者_Python百科bout 300 products (not many but enough). Most of them are configurable so I will be entering a bunch of info then putting it together. Each simple product that makes up a config product has its own sku, so why would a configurable product need a sku?
SKU is a primary key that does not rely on automatically generated db indexes although when dealing with bundles you can generate the SKU dynamically.
Main reason for that is to gain database irrelevance and enable easy import and export of database contents (cause the items are not identified by auto id's and such that will give troubles if imported and exported and increment id's or duplicates already exist)
So for configurable products you still need SKU to identify the group of products or the range of products that can be configured to be one product. Say you have 3 different configurable PC -s available and you get 3 orders , to define them for program you need a group id and do define them for fulfilling order is nice to know what type of configuration client has bought
To be pithy, because every "product" needs a human-usable identifier, and that pretty much defines a SKU. You could use the entity_id (PK column) instead, but then you'll just be pushing the question back a layer.
A valid question, I suppose they did it for consistency. I think it's a good point that a stock keep unit is a thing, and a configurable product is not a thing .. yet SKU is the one piece of information that is kept constant in say.. importing and exporting. I guess they did it for uniqueness rather than to be technically correct. Virtual products wouldn't need skus either, but they are a unit in your system, so they have them. Is there a technical side to your question, or is it purely philosophical?
精彩评论