Try the Demo

Magento Forum

   
A suggestion to import configurable products + categories
 
perandre
Jr. Member
 
Total Posts:  30
Joined:  2009-02-06
 

Thanks for your reply, amartinez!
I’m running the latest 1.3.2.1, no extras, cache deactivated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
perandre
Jr. Member
 
Total Posts:  30
Joined:  2009-02-06
 

Solution to my simple products not connection to the configurable product:
The simple products must be listed before the configurable product!

Wow, this took most of my day...probably something I dind’t read.

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

Ah, haha

smile

I think I say it before in this post

regards!

 Signature 

amartinez {web/developer/designer} free modules: CustomImportExport Like it? Donate!

 
Magento Community Magento Community
Magento Community
Magento Community
 
nafnaf1000
Sr. Member
 
Total Posts:  209
Joined:  2008-02-21
 

I got this working....  Wahooooo.

can thins be configured to update Product Attribute souch as “Manufacturer”

so it will now be “products + categories+update Attribute” smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
perandre
Jr. Member
 
Total Posts:  30
Joined:  2009-02-06
 

Concerning categories: Is it possible to deal with subcategories? A typical scenario is where I have Mens and Womens as subcategories in several other categories...how do we work this without using category_ids?

Grrreat work!

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 
perandre - 16 June 2009 11:54 PM

Concerning categories: Is it possible to deal with subcategories? A typical scenario is where I have Mens and Womens as subcategories in several other categories...how do we work this without using category_ids?

Grrreat work!

please see to _addCategories (I explain it before) This function explode first by slash “/” then by comma “,”

try it and please post here your results

thank you!

 Signature 

amartinez {web/developer/designer} free modules: CustomImportExport Like it? Donate!

 
Magento Community Magento Community
Magento Community
Magento Community
 
BinaryOnFire
Jr. Member
 
Total Posts:  3
Joined:  2009-03-19
 

Hi,

I feel really dumb but I’m wondering what the proper way to associate a configurable product with a simple product is in the CSV.

So I make a CSV that looks like this:

“sku”,"websites”,"store”,"has_options”,"type”,"attribute_set”,"config_attributes”,"news_from_date”,"categories”,"name”,"image”,"small_image”,"thumbnail”,"options_container”,"status”,"visibility”,"weight”,"description”,"qty”,"is_in_stock”,"assort”,"size”,"Wholesale”,"Normal”,"price”,"associated"

but is there a delimiter for associated products? So do I do something like “Normal”,"price", “associated-Sku1, associated-Sku2”
Or do i make a sepreate line in the csv for each one?

**Never mind. I found the example CSV file from page 2. RTFM wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
BinaryOnFire
Jr. Member
 
Total Posts:  3
Joined:  2009-03-19
 

Im trying to use this script and every time I try to run the advanced profile I get an error

# Skip import row, required field “short_description” for new products not defined

Im wondering if anyone else has experienced this and what I can do about it? I attempted to add a field short_description to the end of the csv lines but to no avail.

 
Magento Community Magento Community
Magento Community
Magento Community
 
freshman66
Jr. Member
 
Total Posts:  25
Joined:  2009-04-29
 

Hi guys,
I am using Antonios script to import around 18000 records to Magento - at least I am trying to. It doesn’t really work the way I want because of the memory leak which is hidden somewhere within the Magento API and the script fails at 128 MB (or 256 MB respectively). I know that this is not a new discovery but I still wanted to ask how you get around that problem. Raising the PHP memory limit doesn’t seem to be a reasonable option.
Are you doing the import in several steps (files)?
Cheers, Lars_Stecken

 
Magento Community Magento Community
Magento Community
Magento Community
 
derfurth
Jr. Member
 
Total Posts:  17
Joined:  2008-03-10
 

I have a weird warning when i try to import a csv:

Just after: Starting catalog/convert_adapter_productimport :: parse

Warning: unlink(/var/www/vhosts/xxxxx.xxx/httpdocs/media/catalog/product/) [function.unlink]: Is a directory in /var/www/vhosts/xxxxx.xxx/httpdocs/app/code/core/Mage/Catalog/Model/Convert/Adapter/Productimport.php

Does anyone know what should i do?

--edit

I don’t have this error message anymore, seems that the csv had a problem :)

 
Magento Community Magento Community
Magento Community
Magento Community
 
freshman66
Jr. Member
 
Total Posts:  25
Joined:  2009-04-29
 

Hi again,

I wanted to share an interesting finding:

I am using Antonio’s script with 1.3.2.1 and ran into a problem while importing configurable products by the provided cron file. associated products didn’t get attached and also when I tried to edit the configurable product in the admin area I got a blank page with this error “Call to a member function getId() on a non-object in Model/Product/Type/Configurable.php on line 221.”
Then I tried to import the same CSV via “Advanced Profile” it worked. So I just commented out the “configurable” part in the cron script and it also worked.

Maybe something has changed in the latest version. Can anybody confirm this behaviour?

Cheers, Lars_Stecken

 
Magento Community Magento Community
Magento Community
Magento Community
 
snowman58
Member
 
Total Posts:  54
Joined:  2009-04-09
 

I tore my hair out trying to get this to work with 1.3.2.1. I could make a simple sample work, but a full on upload simply stalled without an error message.

After a couple days of playing around, I discovered that the text in my Description field was the problem. The text includes html and raw text. I have not isolated what aspect caused the problem, but the same text uploads fine using the standard import function.

As best I can tell this code does not change the description import. That’s why it took me so long to figure it out where the problem was.

If it works in the standard import, why does it not work with this import?

I solved the issue by NOT using Excel to create the CSV. Excel worked for the std import, but this extension did not like it much.

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

Hi Toni,

I am using your great extension but I am having a small problem. All
categories that end with an s are duplicated but than without the s.

,"Dameskleding/Jassen & blazers/Blazers”,

becomes

,"Dameskleding/Jassen & blazer/Blazers”,

Even stranger, the s from the category Blazers is not cut of.

I could really use your advice.

Kind regards,
Sjoerd

Hi! smile

Please find these line and comment it:

$categoryPathStr = preg_replace( ‘#s*/s*#’, ‘/’, trim( $categoryPathStr ) );

to ->

// $categoryPathStr = preg_replace( ‘#s*/s*#’, ‘/’, trim( $categoryPathStr ) );

Regards!

 Signature 

amartinez {web/developer/designer} free modules: CustomImportExport Like it? Donate!

 
Magento Community Magento Community
Magento Community
Magento Community
 
snowman58
Member
 
Total Posts:  54
Joined:  2009-04-09
 

I am finally getting this script figured out, but still have a couple questions:

1) Each time the script is run, it adds a new option block to a configurable product page. Is there a solution short of deleting the product first?

2) The Gallery import seems to work, except they do not show up. I have read that they have to be enabled, but I have been unable to find out how to do that.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

HI!

1/ To avoid option block duplication, there’s a $new variable, that set’s to true when a products already exists. This is working fine for me, please look at:

$new true// fix for duplicating attributes error
        
if ( $productId {
            $product 
-> load$productId );
            
$new false// fix for duplicating attributes error
            
}

and later:

if ( $new // fix for duplicating attributes error
                        
$usingAttributeIds[] $attribute -> getAttributeId();
                        
}

2/ What do you means with Gallery? normal images? special gallery images? This is added by these line:

$product -> addImageToMediaGalleryMage :: getBaseDir'media' ) . DS 'import/' $file$fieldsfalse );

But a look to this function returns us the complete list of parameters:

/**
     * Add image to media gallery
     *
     * @param string        $file              file path of image in file system
     * @param string|array  $mediaAttribute    code of attribute with type 'media_image',
     *                                         leave blank if image should be only in gallery
     * @param boolean       $move              if true, it will move source file
     * @param boolean       $exclude           mark image as disabled in product page view
     */
    public function addImageToMediaGallery($file$mediaAttribute=null$move=false$exclude=true)
    
{
        $attributes 
$this->getTypeInstance(true)->getSetAttributes($this);
        if (!isset(
$attributes['media_gallery'])) {
            
return $this;
        
}
        $mediaGalleryAttribute 
$attributes['media_gallery'];
        
/* @var $mediaGalleryAttribute Mage_Catalog_Model_Resource_Eav_Attribute */
        
$mediaGalleryAttribute->getBackend()->addImage($this$file$mediaAttribute$move$exclude);
        return 
$this;
    
}

so please make some tries, like addding “false” to exclude:

$product -> addImageToMediaGalleryMage :: getBaseDir'media' ) . DS 'import/' $file$fieldsfalsefalse );

or to add some attribute too (please refer to magento forums to learn about his codes:

$product -> addImageToMediaGalleryMage :: getBaseDir'media' ) . DS 'import/' $file'gallery'falsefalse );

despite, is a better option to add column ‘gallery’ etc to your csv

see you!

snowman58 - 25 June 2009 11:24 AM

I am finally getting this script figured out, but still have a couple questions:

1) Each time the script is run, it adds a new option block to a configurable product page. Is there a solution short of deleting the product first?

2) The Gallery import seems to work, except they do not show up. I have read that they have to be enabled, but I have been unable to find out how to do that.

Thanks!

 Signature 

amartinez {web/developer/designer} free modules: CustomImportExport Like it? Donate!

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