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

Adding new products using import profile
 
adityak
Member
 
Total Posts:  63
Joined:  2008-02-10
India
 

I am trying to upload new products by entering them in an MS Excel XML file.
I have added a few products manually and exported them to an XML file.
When I add new products to this file and upload it I get the error:

Problem saving the collection, aborting. Error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento/catalog_product_store`, CONSTRAINT `FK_CATALOG_PRDUCT_STORE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE)

I have assigned a value to entity ID for new products- is this causing a problem?
If I don’t assign an entity ID, the profile runs successfully, but the product is not reflected in the catalog.

Image Attachments
product import.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
JoshBelke
Member
 
Total Posts:  64
Joined:  2008-02-12
NY, NY
 

Tried two imports as well.

First off,
I swap around all the values in Excel and tried exporting with CSV/TSB (both actually) filename: A.csv
Neither force quotes, and the importer requires a value encapsulating the contents between the delimiters.(’,’)

So then i attempted an XML export via Excel and ran into this same issue. C.xml
Starting Varien_Convert_Adapter_Http :: load
“ “ :: parse
Found worksheet “A.csv” with 244 row(s) <------ It is supposed to be uploading C.xml… (reused-saved same profile)
renders.. “base” store found
!!!!Problem saving the collection, aborting. Error: SQLSTATE[2300]:Integrity constraint violation: 1452
Cannot add or update a child row: a foreign key constraint fails.

So i create a brand new import profile… Name it C_import
I name file: c.xml
I upload c.xml

and get Found worksheet"A.csv" again…

and the same error....
-----------------------------------------------------------------

Then i started looking at the Excel data, and i payed attention to the Entity_ID ...

You will notice that :
<Row>
<Cell><Data ss:Type="String">base</Data></Cell>
<Cell><Data ss:Type="String">modules</Data></Cell>
<Cell><Data ss:Type="String">Grouped Product</Data></Cell>
<Cell><Data ss:Type="Number">1.860176E6</Data></Cell>
<Cell><Data ss:Type="String">n01860-176</Data></Cell>
<Cell><Data ss:Type="String">Enabled</Data></Cell>
<Cell><Data ss:Type="String">Catalog, Search</Data></Cell>
<Cell><Data ss:Type="String">gym-SUS12 VFIL-H Suction Module(1)</Data></Cell>
<Cell><Data ss:Type="String">n01860-176</Data></Cell>
<Cell><Data ss:Type="String">n01860-176</Data></Cell>
<Cell><Data ss:Type="String">VFIL-H Suction Module</Data></Cell>
<Cell><Data ss:Type="String">n/0/n01860-176</Data></Cell>
<Cell><Data ss:Type="String">Use config</Data></Cell>
<Cell><Data ss:Type="String">n/0/n01860-176</Data></Cell>
<Cell><Data ss:Type="String">n/0/n01860-176</Data></Cell>
<Cell ss:Index="19"><Data ss:Type="String">VFIL-H Suction Module</Data></Cell>
</Row>

<Cell><Data ss:Type="Number">1.860176E6</Data></Cell> <--- Excel (Micro$oft) is attempting to think for you and put the value in Scientific notation.

*remember to highlight the column, select Format, change it from “Number” to Text.

Save ... and now “String” will be properly applied.

Interactive upload still not working for XML....

Attempt to remotely upload file to var/import/ under C.xml

still saying “Found worksheet “A.csv” with 244 rows”

*scratches head and keeps looking around*

Ill tell keep you posted if i get any farther.

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