简体   繁体   中英

Programatically creating Configurable products in Magento 1.8.1

I have a Magento 1.8.1.0 website where I've imported around 3500 Simple Products using the SOAP API.

I need to be able to create Configurable Products which groups Simple Products based on an SKU pattern, but don't know how to do this programatically. Due to the number of products I can't do this manually because of how long it would take.

The website sells swimwear and the Simple Products are the Size and Colour options. I've added a lot of custom attributes to store details of colour and size, to the Default attribute group.

The Simple Products may look like this:

SKU: XX3736 (32)
SKU: XX3736 (34)
SKU: XX3736 (36)
SKU: XX3736 (38)

Numbers in brackets represent the Size. I've added an attribute which has common part of the SKU - in the above example XX3736 on all 4 Simple Products - so they can be identified as the same product.

Some questions:

  1. How to programatically create the Configurable Products? I've read various posts such as http://blog.omnisubsole.com/2009/07/01/configurable-products-in-magento/ but this seems old (from 2009) and very complicated.

  2. When creating the Simple Products, the product Name is the same in each instance, eg on the example above all 4 products are called "Speedo Fastskin 3". Is that correct or do the name need to differ so they can be identified with their Size? If it's wrong how could this be displayed on the front-end?

  3. When I was importing the Simple Products I added things like the Description text to each one. But the products are set to "Not Visible Individually". Is it really necessary to import this data for each Simple Product? I know Magento requires certain fields but it seems strange to import data that's not actually shown anywhere.

Thanks in advance.

Also, it's disappointing that the API doesn't (seem to) support an easy method to do this? Does anyone know if there are plans to have this in later versions? Seems very odd that it's relatively easy to import the Simple Products but so hard to create Configurables from them!

回答了我自己的问题,但最后是有效的方法,并进行了一些修改: http : //www.codetweet.com/magento/create-configurable-product-magento-programmatically/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM