Magento Forum

   
Problem with updating stock quantities/importing products. 
 
solarisx
Jr. Member
 
Total Posts:  1
Joined:  2009-05-10
 

Whenever I try to either import new products or update product stock quantities I keep getting this error:

SQLSTATE[23000]Integrity constraint violation1452 Cannot add or update a child rowa foreign key constraint fails (`solaris_beautycarecentral`.`cataloginventory_stock_status`, CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_STOCKFOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DE)

Any help is greatly appreciated on this issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
acstudios
Jr. Member
 
Total Posts:  15
Joined:  2008-08-19
 

I’m having the same problem.  Were you able to get this resolved?

 
Magento Community Magento Community
Magento Community
Magento Community
 
merchantguru
Sr. Member
 
Avatar
Total Posts:  133
Joined:  2008-10-05
San Francisco
 

I had a similar problem. I had imported products from xcart, but must have missed a step. In cataloginventory_stock_item and cataloginventory_stock_status, there’s a field stock_id that references cataloginventory_stock.stock_id.  When I imported, I set them all to 1. Turns out, you should add a record in cataloginventory_stock!

In cataloginventory_stock., I added a record with stock_id 1 and stock_name to Default. Subsequent forum searching revealed that’s what others suggest, too.

I don’t know what a “default” stock name is or does, but it solved my problem. I imagine it allows you to have a different stocking name than what displays publicly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
airbox
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2008-08-11
California
 

This same fix adding those values to the table worked for us, thanks!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
wojt.net
Jr. Member
 
Total Posts:  2
Joined:  2008-08-02
Poland
 

Thanks, it solved my problem with the “stock_id”

 
Magento Community Magento Community
Magento Community
Magento Community
 
crizregala
Jr. Member
 
Total Posts:  7
Joined:  2012-03-04
 
wojt.net - 10 June 2010 11:39 PM

Thanks, it solved my problem with the “stock_id”

please help me.i do what the solution is, but unfortunately it didn’t work.please please help me

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