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

A suggestion to import configurable products + categories
 
Trias9
Jr. Member
 
Total Posts:  12
Joined:  2010-06-24
 

Hello everybody!
I have a next situation. An import works on 100% for it thank who worked all above creation of this script.
But here when I call at a shop, at the choice of commodity I do not have a choice of sizes, for this purpose I need in admin to call catalog/manage products, to choose every configurable, open him, choose associated products and save(nothing change,only open that page). After I can choose it sizes on the page of commodity in a shop. In what problem prompt me please, who ran already into it. Tried to index and renew attributy, nothing helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ben Fitzhardinge
Jr. Member
 
Avatar
Total Posts:  29
Joined:  2010-03-25
 

could somebody please post me an .csv file that works with the import script for Magento ver 1.4.1.1 ?
i am still getting mysql syntax errors, and i really want to rule out user error.

cheers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
narrok
Jr. Member
 
Total Posts:  29
Joined:  2010-05-31
 
Ben Fitzhardinge - 02 August 2010 09:37 PM

could somebody please post me an .csv file that works with the import script for Magento ver 1.4.1.1 ?
i am still getting mysql syntax errors, and i really want to rule out user error.

cheers.

I’m also having the same problem trying to upload to Magento 1.4.1.1.

Please let me know if you solve it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
tonegolf71
Jr. Member
 
Total Posts:  21
Joined:  2008-10-14
 

I’m importing into 1.4.1.1 and it is working (with grouped products).

I weirdly get an error spat out three times for every row though and I cannot see where it is coming from and I can’t see anywhere that it is affecting, I just want to fix it as it is making it hard to fix other issues in my feed.

The error is:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 0)’ at line 1

Does anyone know how we can see what SQL code is actually being executed so we can track this down?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
phillyj8
Jr. Member
 
Total Posts:  27
Joined:  2008-06-12
 

I’m having the same issue as @Ed.Madrigal and other with stock levels not importing.  I’ve managed to get every single other part of the import working, but some reason both configurable and simple products show as Out of Stock, and simple products have 0 Qty (even though the is_in_stock and qty fields are set correctly in the .csv).

I’m using 1.4.1.0.

Anyone have any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
narrok
Jr. Member
 
Total Posts:  29
Joined:  2010-05-31
 
tonegolf71 - 05 August 2010 01:56 PM

I’m importing into 1.4.1.1 and it is working (with grouped products).

I weirdly get an error spat out three times for every row though and I cannot see where it is coming from and I can’t see anywhere that it is affecting, I just want to fix it as it is making it hard to fix other issues in my feed.

The error is:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 0)’ at line 1

Does anyone know how we can see what SQL code is actually being executed so we can track this down?

Thanks.

Could you manage to fix this issue ? I have tried several things but none of them worked.

Someone help please!

 
Magento Community Magento Community
Magento Community
Magento Community
 
ciriglezglez
Member
 
Total Posts:  40
Joined:  2009-11-18
 

Hello

I have the same problem as Trias. I am able to import configurable products, but I can´t see all the posible configurations in front-end until I save the product in back-end. This is a really annoying thing.

Can anyone help me?

 
Magento Community Magento Community
Magento Community
Magento Community
 
milk8800
Jr. Member
 
Total Posts:  5
Joined:  2010-05-09
 

Hi I done everything but it show following, can you help me to take a look my problem, many thanks

Skip import row, required field “sku” not defined
Skip import row, required field “sku” not defined
Skip import row, required field “sku” not defined
Skip import row, required field “sku” not defined
Processed 100% 134/134 records
Imported 0 records

attached with the CSV UTF-8

File Attachments
export_all_products.txt  (File Size: 4KB - Downloads: 166)
 
Magento Community Magento Community
Magento Community
Magento Community
 
tonegolf71
Jr. Member
 
Total Posts:  21
Joined:  2008-10-14
 
milk8800 - 13 August 2010 05:36 AM

Hi I done everything but it show following, can you help me to take a look my problem, many thanks

Skip import row, required field “sku” not defined
Skip import row, required field “sku” not defined
Skip import row, required field “sku” not defined
Skip import row, required field “sku” not defined
Processed 100% 134/134 records
Imported 0 records


attached with the CSV UTF-8

As that error suggests your “sku” column is empty, sku is a required field in magento and has to be unique. It is usually a model code of some sort. grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
tonegolf71
Jr. Member
 
Total Posts:  21
Joined:  2008-10-14
 
narrok - 11 August 2010 07:23 AM

tonegolf71 - 05 August 2010 01:56 PM
I’m importing into 1.4.1.1 and it is working (with grouped products).

I weirdly get an error spat out three times for every row though and I cannot see where it is coming from and I can’t see anywhere that it is affecting, I just want to fix it as it is making it hard to fix other issues in my feed.

The error is:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 0)’ at line 1

Does anyone know how we can see what SQL code is actually being executed so we can track this down?

Thanks.

Could you manage to fix this issue ? I have tried several things but none of them worked.

Someone help please!

I think I’ve tracked down the first bit of this but if anyone can confirm I am correct that would be good…

On line 75 of the cron_import file I have..

if ( $customer_group['customer_group_code'!= 'General' && $customer_group['customer_group_code'!= 'NOT LOGGED IN'{

and I have changed it to…

if ( $customer_group['customer_group_code'!= 'General' && $customer_group['customer_group_code'!= 'NOT LOGGED IN' && $importData[$customer_group['customer_group_code']] != ""{

As far as I can see it is looking in the csv for a customer group column of which I don’t have, but it was not trapped for.

Also, I was getting further errors that didn’t seem to affect the import but bugged me… they were…

ROW 100PARENT SKU JSS03_groupPRODUCT SKU JSS03 SQLSTATE[42000]Syntax error or access violation1064 You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near ' 1)' at line 1

Having dug deeper i’ve commented out the following lines from the same file…

$attribute_id $write -> fetchOne"select * from $attribute_table where attribute_code='" $importData['config_attributes'"'" );
if ( !
$write -> fetchOne"select * from $index_eav_table where store_id=" $store_id " and entity_id=" . ( int )$parent_id " and attribute_id=" . ( int )$attribute_id ) ) {
    $write 
-> query"insert into $index_eav_table (store_id, entity_id, attribute_id, value) values (" $store_id ", " . ( int )$parent_id ", " $attribute_id ", " $valueCount++ . ")" );
    
}

They seem to be checking the config_attributes column of my csv, but I think because I have 2 comma seperated (in quotes) items in here the code will not match attributes in the store. My config_attributes column has “finish, backplate_variation” in it, but when I printf($attribute_id) after that first line of code it is empty.

The thing I don’t get is what this bit of code is supposed to be doing? What is it that for the grouped product it has to insert in the db to do with the additional attributes… confused confused

 
Magento Community Magento Community
Magento Community
Magento Community
 
milk8800
Jr. Member
 
Total Posts:  5
Joined:  2010-05-09
 

Thank a lot, I will try again

I have a question....if I do it success, what going on of my old products? it disappear or keep inside no change????

 
Magento Community Magento Community
Magento Community
Magento Community
 
tonegolf71
Jr. Member
 
Total Posts:  21
Joined:  2008-10-14
 

Your existing products will not be affected by the import.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ed.Madrigal
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2010-06-29
 

I have attached my Product import file. I have Qty’s importing, and all products.

BUT!!!!

When I look at the product in the frontend I don’t see the options??

Strange thing is once I go into the configurable Item on the backend, and hit save. Then view it on the frontend again there they are?

I exported the record before and after the save. The only difference is the between them is the “has_option” feild turn from 0 to 1.

Which is strange since my CSV has it already set to 1.

I also tired to manually change it is the flat and entity tables but no luck.

Any ideas???

MY CSV

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

"9785-101509"
,"base","admin","0","simple","Default","size",,"Collectors Batgirl Adult",,,,"Product Info Column","Enabled","Taxable Goods","Nowhere",4.60,533.87,"Includes full leotard, corset, cape, boot tops, eye mask, gloves and shoulder pieces.  This is an officially licensed Batman  product.  May differ slightly from shown.","Collectors Batgirl Adult","1","1","Medium","Adult Costumes/WOMEN",,"242.67",,

"9785-101508","base","admin","0","simple","Default","size",,"Collectors Batgirl Adult",,,,"Product Info Column","Enabled","Taxable Goods","Nowhere",3.50,533.87,"Includes full leotard, corset, cape, boot tops, eye mask, gloves and shoulder pieces.  This is an officially licensed Batman  product.  May differ slightly from shown.","Collectors Batgirl Adult","9","1","Large","Adult Costumes/WOMEN",,"242.67",,

"9785","base","admin","1","configurable","Default","size",,"Collectors Batgirl Adult",,,,,"Enabled","Taxable Goods","Catalog, Search",0.00,291.20,"Includes full leotard, corset, cape, boot tops, eye mask, gloves and shoulder pieces.  This is an officially licensed Batman  product.  May differ slightly from shown.","Collectors Batgirl Adult","0","1",,"Adult Costumes/WOMEN","9785-101508,9785-101509","0",,
File Attachments
Productimport-mod-works-sqlfix.php  (File Size: 18KB - Downloads: 146)
 
Magento Community Magento Community
Magento Community
Magento Community
 
Artturi
Jr. Member
 
Total Posts:  2
Joined:  2010-08-08
 
amartinez - 26 May 2009 10:07 PM

mageuser - 26 May 2009 09:00 PM
Antonio,
in order to have less difficulties to retrieve all necessary files and instruction I created this wiki page
I added only the instructions for the moment. Could you please upload the files and everything you think usefull?

Thanks

sure! do you create a fabulous wiki! I’m uploading all files now…

regards,

Antonio

Hello,

I just used these scripts and found one issue with my setup where there are two selectable options (size and frame).

In cron_import_products around line 93, I changed the code to get this (basically explode the string with configurable attributes) :

if ( $importData['type'== 'configurable' // for configurable products
                                
$parent_id $write -> fetchOne"select * from $product_table where sku='" $importData['sku'"'" );
                                
$config_attributes explode(",",$importData['config_attributes']);
                                foreach (
$config_attributes as $config_attribute)
                                
{
                                  $attribute_id 
$write -> fetchOne"select * from $attribute_table where attribute_code='" $config_attribute "'" );
                                  echo 
$attribute_id "\n";
                                  if ( !
$write -> fetchOne"select * from $super_attribute_table where product_id=" . ( int )$parent_id " and attribute_id=" . ( int )$attribute_id ) ) {
                                      $write 
-> query"insert into $super_attribute_table (product_id, attribute_id) values (" . ( int )$parent_id ", " . ( int )$attribute_id ")" );
                                      
}
                                }
                                
foreach ( explode','$importData['associated') as $product_sku {

Without this, the configurable product was created but when I clicked on it via the admin panel, I got a fatal error in Configurable.phop line 222.

Regards,

Mikael

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pure Linen
Jr. Member
 
Total Posts:  4
Joined:  2010-08-17
 

Hi ... This importer looks like a God-Send.

The scary thing is that this thread is now nearly 30 pages long and for someone just starting out in Magento on the current version 1.4.1.1 ... where does one start reading?

Would it be possible of some kind contributor to upload a set of steps 1 ...n for getting this plugged into 1.4.11
Perhaps uploaded as a document file, rather than pasted into the forum message.

I realise this is a big ask ... but if someone is in a position to do that, I’d be most grateful

Thanks
Roger
cool smile

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