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

catalog_product_entity - please help! 
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

I’ve asked this before but never got an answer, so I’m trying again.

All the values for SKU in catalog_product_entity are NULL.  Is this correct?  The SKUs are in the catalog_product_entity_varchar table, under attribute_id 48.

The site seems to function OK, SKUs are editable from the backend, but certain 3rd party modules fail to see the SKUs.

Can anyone help, please...?

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Creating new products still leaves the field as NULL, too, but the Amazon Import by ebizmarts requires the SKU in the catalog_product_entity table...!

Maybe someone could just check the table in their own installation, please?  It’s driving me mad this, has been doing for over a month.

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Added to bug tracker in the hope of getting a solution.

http://www.magentocommerce.com/bug-tracking/issue?issue=2433

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michael_1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

I’m posting the solution here for those who might experience the same problem:

You can try the following SQL to fix this:

SELECT @attribute_id := `attribute_id`
FROM `eav_attribute`
WHERE `entity_type_id`=(SELECT `entity_type_id`
FROM `eav_entity_type`
WHERE `entity_type_code` = 'catalog_product'
)
AND `
attribute_code` = 'sku';
UPDATE `eav_attributeSET `backend_type`='static'
WHERE `attribute_id`=@attribute_id;

UPDATE `catalog_product_entity` as `p`
INNER JOIN `catalog_product_entity_varchar` as `pv`
ON `pv`.`entity_id`=`p`.`entity_id`
AND `
pv`.`store_id`=0
AND `pv`.`attribute_id`=@attribute_id
SET 
`p`.`sku`=`pv`.`value`;

Please make sure that you make a backup prior to running it.

The SQL below will clean the old values after you check that everything is ok:

SELECT @attribute_id := `attribute_id`
FROM `eav_attribute`
WHERE `entity_type_id`=(SELECT `entity_type_id`
FROM `eav_entity_type`
WHERE `entity_type_code` = 'catalog_product'
)
AND `
attribute_code` = 'sku';

DELETE FROM `catalog_product_entity_varchar`
WHERE `attribute_id`=@attribute_id;
 
Magento Community Magento Community
Magento Community
Magento Community
 
Corllete Ltd
Member
 
Avatar
Total Posts:  47
Joined:  2007-11-08
Bulgaria
 

This worked like a charm. Solved me a lot of problems with SKU searches, API calls etc. Thank you Thank you Thank you

Regards

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