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

Configurable Products? 
 
magewidgets
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2010-03-24
USA
 

 

 
Magento Community Magento Community
Magento Community
Magento Community
 
bolasevich
Sr. Member
 
Avatar
Total Posts:  235
Joined:  2008-03-04
Newington, CT USA
 

Your so far off base its not even funny. Its hurtful and really angers me when im spending 8+ hours a day developing extensions and bug fixes and support and not a single unhappy customer and on top of that I’ve contributing numerous “free” scripts and code and yet i come on here and people like you find it necessary to bash my efforts, call me a liar and tell me im not actually doing the work when im physically sitting here doing it. Ive been programming for 15yrs and was the webmaster for yale.edu and General Electric. Im more then qualified to be programming and have been for a very long time. And there isn’t a single post on the entire magentocommerce.com website that shows all of the code i’ve written. None of these people have posted code for importing product_tags with this extension. None of the people have posted code for importing downloadable products via URL and via files from the media/import. No one has the code i wrote for import of bundle products and NO ONE HAS any of my export code for the products extension on top of the other 18 extension ive developed. This code in the forums likely has never been tested on EE since i have additional code to make it work with EE and i dont see that anywhere. The list is endless in the differences and Its people like yourself that ruin the community and push hard working developers like myself away from a great platform. Its unfortunate my working for free isn’t a good enough give back for you maybe i’ll give you my right arm while im at it and my laptop and you can just come live in my house for free too.. pathetic. Maybe you should use your time to learn how to contribute something useful instead of pointless degrading comments that help no one and then i have to spend my time defending myself when i could be developing more extensions. Im getting really sick of having to do this and to anyone else that thinks they have some type of claim to them i say PROVE IT instead of making up lies and false claims. Because i can prove im doing the work and i wrote the code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
webscot
Sr. Member
 
Total Posts:  192
Joined:  2009-05-12
 

@bolasevich,

First, thank you for your contributions.

As for the ongoing banter, I believe everyone has the opportunity to develop apps and receive remuneration for your efforts. Look at Varien. They entice with CE (full of bugs) and then charge much more than $100 for EE (the hopefully-bug free, working, advanced version). I can certainly say that I have yet to find any forum post or code (as nice as it might be to find) that explains how to import configurable products including price change levels for each of the simple products associated with the configurables.

If the other poster can provide this for free (not to take away from you) please step up and do it! We could certainly all benefit.

Furthermore, even if you had compiled data from the forums and then offered it for a fee, that too can be a service worth compensation for those either incapable of combining it themselves or those that do not wish to take the time to do so. If anybody is ambitious enough to spend the time ferreting out this information from the forums for free, thus is your compensation for time spent finding the information.

Now on to my question. The code you posted looks very similar to what I have in app/code/local/Mage/Catalog/Model/Convert/Adapter/Productimport.php. Being that my code is a bit different, I am asking if you are suggesting changing this file for it to work properly?

We attempted to import using this in Advanced Profiles and also just to perform a normal import using Import/Profiles/Import All Products and ran into the same problem using both methods. IMAGES WON\’T IMPORT! Other settings seem to import OK, but not the images. If you are willing to help with this, I thank you in advance. If not, I understand and request the assistance of anyone else to help.

The following is the code in our Prouctimport.php file that is similar to your post:

if ( $importData[\'type\'== \'configurable\' {
            $product 
-> setCanSaveConfigurableAttributestrue );
            
$configAttributeCodes $this -> userCSVDataAsArray$importData[\'config_attributes\');
            
$usingAttributeIds = array();
            foreach( 
$configAttributeCodes as $attributeCode {
                $attribute 
$product -> getResource() -> getAttribute$attributeCode );
                if ( 
$product -> getTypeInstance() -> canUseAttribute$attribute ) ) {
                    
if ( $new // fix for duplicating attributes error
                        
$usingAttributeIds[] $attribute -> getAttributeId();
                        

                    } 
                } 
            
if ( !empty( $usingAttributeIds ) ) {
                $product 
-> getTypeInstance() -> setUsedProductAttributeIds$usingAttributeIds );
                
$product -> setConfigurableAttributesData$product -> getTypeInstance() -> getConfigurableAttributesAsArray() );
                
$product -> setCanSaveConfigurableAttributestrue );
                
$product -> setCanSaveCustomOptionstrue );
                

            
if ( isset( $importData[\'associated\') ) {
                $product 
-> setConfigurableProductsData$this -> skusToIds$importData[\'associated\']$product ) );
                

            }
 
Magento Community Magento Community
Magento Community
Magento Community
 
bolasevich
Sr. Member
 
Avatar
Total Posts:  235
Joined:  2008-03-04
Newington, CT USA
 

 

 
Magento Community Magento Community
Magento Community
Magento Community
 
webscot
Sr. Member
 
Total Posts:  192
Joined:  2009-05-12
 

@Scott

Any more thoughts on the issue above in my post above?. I tried the import using the UTF-8 file in OO and still those images won’t show! Import is successful and text is importing fine; just no images. I tried again to export and use the Magento export file and then just change the image path.

I did find another forum where they are having this problem too. This is just a bit ridiculous at this point. I just want to launch....

 
Magento Community Magento Community
Magento Community
Magento Community
 
websonica
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2009-04-25
 
bolasevich - 11 March 2010 06:59 PM

RE: sinrow

$product->getTypeInstance()->setUsedProductAttributeIds($usingAttributeIds);
                
$updateconfigurablearray = array();
                
$insidearraycount=0;
                
$finalarraytoimport $product->getTypeInstance()->getConfigurableAttributesAsArray();
                
$updateconfigurablearray $product->getTypeInstance()->getConfigurableAttributesAsArray();
                
                    foreach(
$updateconfigurablearray as $eacharrayvalue{
                     $finalarraytoimport[$insidearraycount][
'label'$eacharrayvalue['frontend_label'];
                     
$insidearraycount+=1;
                    
}
                $product
->setConfigurableAttributesData($finalarraytoimport);

I think the code could be further simplified with only 1 array and no counter as follows:

$product->getTypeInstance()->setUsedProductAttributeIds($usingAttributeIds);
                
$attributes_array $product->getTypeInstance()->getConfigurableAttributesAsArray();

                foreach(
$attributes_array as $key => $attribute_value{
                    $attributes_array[$key][
'label'$attribute_value['frontend_label'];
                
}
                $product 
-> setConfigurableAttributesData($attributes_array);
 
Magento Community Magento Community
Magento Community
Magento Community
 
temgra
Member
 
Avatar
Total Posts:  34
Joined:  2008-08-11
 

@sinrow

It’s just incredible how you feel so free to write here false accusations and slanderous statements about other people and their work. I can speak for myself - temgra.com doesn’t sell stolen code, I have never asked in German forums (or elsewhere) other coders to help me rewrite my own extensions or how I can hide the code. I am not sure what the reason for your acting is, but I already contacted the Magento team and hope that this wouldn’t stay without consequences for you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
neuromancer8
Jr. Member
 
Total Posts:  15
Joined:  2009-09-28
 

I, for one, am very glad of the dialogue and the sharing in this forum.  We upgraded to 1.4.1 and immediately hit a stone wall with the SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘value’ cannot be null problem.

We might be out of business if we had not had an opportunity to peruse the codes suggested here. 

This community is a mix of people who write code for a living and people who need the code in order to make a living selling on line.  What’s offered here is free and open and very much appreciated.  If anyone builds on these ideas to develop their own business, as we have just done with our website, that seems to me to be part of the Open Source “contract”.

Thanks code writers!

 
Magento Community Magento Community
Magento Community
Magento Community
 
rich15swan
Jr. Member
 
Total Posts:  5
Joined:  2010-03-18
 

@neuromancer8

I am currently having the same issue what was the solution that you came across?

 
Magento Community Magento Community
Magento Community
Magento Community
 
plasmagunman
Jr. Member
 
Total Posts:  4
Joined:  2010-06-02
 
rich15swan - 21 June 2010 02:41 AM

@neuromancer8

I am currently having the same issue what was the solution that you came across?

for me the patch of @caligola worked like a charm:
in file app/code/local/Mage/Catalog/Model/Convert/Adapter/Productimport.php find the code

if ( !empty( $usingAttributeIds ) ) {
    $product 
-> getTypeInstance() -> setUsedProductAttributeIds$usingAttributeIds );
    
$product -> setConfigurableAttributesData$product -> getTypeInstance() -> getConfigurableAttributesAsArray() );
    
$product -> setCanSaveConfigurableAttributestrue );
    
$product -> setCanSaveCustomOptionstrue );
}
and replace it with
if ( !empty( $usingAttributeIds ) ) {
    $product 
-> getTypeInstance() -> setUsedProductAttributeIds$usingAttributeIds );
    
$attributes_array $product->getTypeInstance()->getConfigurableAttributesAsArray();
    foreach(
$attributes_array as $key => $attribute_value{
        $attributes_array[$key][
'label'$attribute_value['frontend_label'];
    
}
    $product 
-> setConfigurableAttributesData($attributes_array);
    
$product -> setCanSaveConfigurableAttributestrue );
    
$product -> setCanSaveCustomOptionstrue );
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
plasmagunman
Jr. Member
 
Total Posts:  4
Joined:  2010-06-02
 

instead of “category_ids” you can use “categories” to identify the category, the product belongs to. just put in there the name of the category, like “Main Category Name/Sub Category Name”.
a bug in the script prevents you from giving your main categories a name that ends with the letter “s”, to fix that enter app/code/local/Mage/Catalog/Model/Convert/Adapter/Productimport.php and replace the line

$categoryPathStr preg_replace'#s*/s*#''/'trim$categoryPathStr ) );
with
$categoryPathStr preg_replace'#\s*/\s*#''/'trim$categoryPathStr ) );
as a side effect the script will ignore any white spaces before and after the delimiter “/”, looks like this line of code was intended to do that ;-)
 
Magento Community Magento Community
Magento Community
Magento Community
 
plasmagunman
Jr. Member
 
Total Posts:  4
Joined:  2010-06-02
 

ok, i was working with the code from jwpadgett and it looks like he uploaded a new version of the script.
the patch for the “SQLSTATE[23000]” error is applied but i encountered a new (old) problem: the duplicating attributes error.
to fix this find the code

if ($importData['type'== 'configurable'{
    [
...]
            $attr_codes[] 
$cs_attr['attribute_id'];
and replace “attribute_id” with “attribute_code”.
 
Magento Community Magento Community
Magento Community
Magento Community
 
NETZKOLLEKTIV
Member
 
Avatar
Total Posts:  35
Joined:  2010-05-06
Erlangen, Germany
 

Using our commercial API extension package NETZKOLLEKTV Core API enables you to add configurable products via Magento Core API.

For more information see NETZKOLLEKTIV Core API

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tristan_Nguyen
Jr. Member
 
Total Posts:  4
Joined:  2010-06-20
 

Hello all, now i can run import product with Magento 1.4.1.0. Hope it can help you. Here my CSV file :

store,websites,attribute_set,type,category_ids,sku,config_attributes,has_options,name,url_key,meta_title,meta_description,thumbnail,small_image,image,gallery,gift_message_available,options_container,price,cost,weight,minimal_price,model,description,meta_keyword,short_description,custom_layout_update,color,status,tax_class_id,visibility,shirt_size,gender,qty,min_qty,use_config_min_qty,is_qty_decimal,backorders,use_config_backorders,min_sale_qty,use_config_min_sale_qty,max_sale_qty,use_config_max_sale_qty,is_in_stock,low_stock_date,notify_stock_qty,use_config_notify_stock_qty,manage_stock,use_config_manage_stock,stock_status_changed_automatically,use_config_qty_increments,qty_increments,use_config_enable_qty_increments,enable_qty_increments,product_name,store_id,product_type_id,product_status_changed,product_changed_websites,associated
admin
,base,Shirts T,simple,4,1000-b,shirt_size,0,Testing-Name-b,,Testing-Name,The Only ChildrenPaisley T-Shirt,/fs_1011-blk.jpg,/fs_1011-blk.jpg,/fs_1011-blk.jpg,"/fs_1019-whtred.jpg,/fs_1006-blackpink.jpg",Use config,Block after Info Column,15,2,0.44,15,The Only ChildrenPaisley T-Shirt,Testing-Name,Testing-Name,Testing-Name,Block after Info Column,White,Enabled,Taxable Goods,Not Visible Individually,Medium,Mens,241,0,1,0,0,1,1,1,100,1,1,0000-00-00 00:00:00,,1,0,1,0,1,0,1,0,Testing-Name-b,0,simple,,,
admin,base,Shirts T,simple,4,1000-c,shirt_size,0,Testing-Name-c,,Testing-Name,The Only ChildrenPaisley T-Shirt,/fs_1011-blk.jpg,/fs_1011-blk.jpg,/fs_1011-blk.jpg,"/fs_1019-whtred.jpg,/fs_1006-blackpink.jpg",Use config,Block after Info Column,15,2,0.44,15,The Only ChildrenPaisley T-Shirt,Testing-Name,Testing-Name,Testing-Name,Block after Info Column,White,Enabled,Taxable Goods,Not Visible Individually,Large,Mens,241,0,1,0,0,1,1,1,100,1,1,0000-00-00 00:00:00,,1,0,1,0,1,0,1,0,Testing-Name-c,0,simple,,,
admin,base,Shirts T,configurable,4,1000,shirt_size,1,Testing-Name,,Testing-Name,The Only ChildrenPaisley T-Shirt,/fs_1011-blk.jpg,/fs_1011-blk.jpg,/fs_1011-blk.jpg,"/fs_1019-whtred.jpg,/fs_1006-blackpink.jpg",Use config,Product Info Column,15,2,0.44,15,The Only ChildrenPaisley T-Shirt,Testing-Name,Testing-Name,Testing-Name,Product Info Column,White,Enabled,Taxable Goods,"Catalog, Search",,Mens,0,0,1,0,0,1,1,1,100,1,1,0000-00-00 00:00:00,,1,0,1,0,1,0,1,0,Testing-Name,0,configurable,,,"1000-b,1000-c"

And PHP file.

File Attachments
Productimport.php  (File Size: 18KB - Downloads: 361)
 
Magento Community Magento Community
Magento Community
Magento Community
 
bolasevich
Sr. Member
 
Avatar
Total Posts:  235
Joined:  2008-03-04
Newington, CT USA
 

@Tristan Nguyen

I’ve had problems importing CSV’s that don’t use double qoutes “” around all fields and values. In your example your missing this. Try using openoffice.org scalc software its free and will restore and keep this format. I find it eliminates alot of issues FYI

Scott

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