Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Problems to create configurable products
 
Bobby
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2007-11-13
 

Hi,

I’m working on a module to import configurable products from a csv file.

I create a new product using

$this->_configurableProduct Mage::getModel('catalog/product');
Then, I set its type_id to 3:
$this->_configurableProduct->setTypeId(3);
To link this product to the simple products:
$this->_configurableProduct->setSuperLinks($superLinks);
$this->_configurableProduct->setSuperAttributes($superAttributes);
Here are the results of the $superLinks and $superAttributes arrays:
//////////////////////SUPER LINKS ARRAY://///////////////////////
*743 ===> //743:id of the simple product
*****===> Array
***********
label ===> 38 //label of the 'taille' attribute (obtained in eav_attribute_option_value)
***********attribute_id ===> 438 //id of the 'taille' attribute
***********value_index ===> //value of the 'taille' attribute (obtained in catalog_product_entity_int)
***********is_percent ===> 0
***********pricing_value ===> 0
*****===> Array
***********
label ===> Orange+d1,63cm //label of the 'color' attribute (obtained in eav_attribute_option_value)
***********attribute_id ===> 62 //id of the 'color' attribute
***********value_index ===> 34 //value of the 'color' attribute (obtained in catalog_product_entity_int)
***********is_percent ===> 0
***********pricing_value ===> 0
//////////////////////SUPER ATTRIBUTES ARRAY://///////////////////////
*===>
*****
attribute_id ===> 62
*****attribute_code ===> color
*****id ===>
*****
frontend_label ===> Couleur
*****values ===> Array
***********
===> Array
**********************
label ===> 38
**********************attribute_id ===> 438
**********************value_index ===> 6
**********************is_percent ===> 0
**********************pricing_value ===> 0
*****label ===> Couleur
*****position ===> 0
*****html_id ===> config_super_product__attribute_0
*===>
*****
attribute_id ===> 438
*****attribute_code ===> taille_chaussures
*****id ===>
*****
frontend_label ===> Taille
*****values ===> Array
***********
===> Array
**********************
label ===> Orange+d1,63cm
**********************attribute_id ===> 62
**********************value_index ===> 34
**********************is_percent ===> 0
**********************pricing_value ===> 0
*****label ===> Taille
*****position ===> 1
*****html_id ===> config_super_product__attribute_1
The configurable product is well created, but when I check the Associated Products menu in Product Information, there is something strange… The simple product is checked, the two configurable attributes are here, but there is no link between them… (you can see what I’m trying to describe in the screenshot attached...).

Any thoughts?

Thanks,
Bobby

Image Attachments
screenshot.JPG
 
Magento Community Magento Community
Magento Community
Magento Community
 
Rohit85
Member
 
Total Posts:  32
Joined:  2008-12-16
 

Hi,

is any body knowing what is the use of the “value_index” attribute in configurable product option, How it’s value set,

Actually i am importing configurable products from the CSV file and i got success in it but i have problem in displaying and i think it’s due to this “value_index” index attribute.

So, is any body knowing about this then please help me

Thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tolick
Jr. Member
 
Total Posts:  5
Joined:  2009-02-09
 

value_index is the option_value_id of the chosen value of the super attribute.

But I have a question:

$this->_configurableProduct->setSuperLinks($superLinks);
$this->_configurableProduct->setSuperAttributes($superAttributes);

I don’t see these methods. I need to link a configurable product to its simple products… I can’t find any APIs to do this… and I’ve searched and these methods do not exist…

thanks,
tom

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top