-
- dax

-
Total Posts: 11
Joined: 2008-04-25
|
Been battling with this for a few days now, and thanks to the posts in this thread have finally found a way of importing configurable products successfully! Heres a summary of the steps taken:
1. Create option attributes (Global, Dropdown, Use for Configurable...)
2. Import configurable product and corresponding simple products per standard instructions, i.e.:
- Create Configurable Product with visibility ‘Catalog, Search’
- Create Simple Products with visibility ‘Nowhere’
Now for some SQL work…
3. Identify the product_id values for each of the Configurable products (use the Magento Admin for this) (eg 10, 20, )
4. Identify the attribute_id for the options attributes created in (1) - see table eav_attribute (eg 101, 102)
5. Link the Configurable products and their super-attributes using SQL as follows:
INSERT INTO `catalog_product_super_attribute` (`product_id`, `attribute_id`, `position`) VALUES (10, 101,0), (10,102,0), (20,101, 0), ...
(note - you do not need to specify a super-attribute id, as this is provided by autonumbering)
6. Link the Simple products to their Configurable “parent” as follows - this method assumes that there is a link between the SKUs of the products. In My case, the Simple products all use the Configurable SKU as a root (eg Config: AAA001 (id=10), Simples AAA001-A, AAA001-B, ...):
INSERT INTO `catalog_product_super_link` (`product_id`, `parent_id`) ( SELECT `entity_id` , 10 FROM `catalog_product_entity` WHERE `sku` LIKE "AAA001-%" );
I have also found a similar (and simpler) solution for activating multiple images after upload:
First: upload the images according to the now tried and tested methods mentioned in the thread
http://www.magentocommerce.com/boards/viewthread/6220/
In my experience, the images are all present in the admin tool, but not visible in the store, and difficult to make them so… but I have found that executing the following two SQL statements seems to fix that.
UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 0 WHERE 1; UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 1 WHERE `value_id` IN ( SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` LIKE "%_th%.jpg" OR `value` LIKE "%_sm%.jpg" );
Again, the exact SQL will depend on your naming conventions: I am using JPGs with the suffixes “_sm” for small and “_th” for thumbnails. The second SQL statement is disabling these to avoid them appearing in the media gallery also.
Note the wildcards (%) between the suffixes and “.jpg” - this is to allow for the case where you have already run the upload in the past, and Magento adds a sequence number to make the name unique. If you are doing a full catalogue upload, you may prefer to remove all images from the /media/catalog/product directories before running your upload.
Hope this helps…
David
|