magento-184.108.40.206 I am using nginx server i would like to change catalog product visibility. only child products.
FROM "Catalog, Search" TO "Not Visible Individually" So please how can i do it from database
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
Mysql: Magento save the relation between
configurable product and it child products at
catalog_product_super_link and save it product basic data at
Write select query with
select type_id=simple simple product and check
that product id exit at
For getting Simple products that are associated with configurable product
SELECT * FROM `catalog_product_entity` where entity_id in (SELECT product_id FROM `catalog_product_super_link`) and type_id='simple'
UPDATE catalog_product_entity_int SET value = 1 WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = "visibility") AND entity_id in (SELECT entity_id FROM catalog_product_entity where entity_id in (SELECT product_id FROM catalog_product_super_link) and type_id='simple');
First and foremost doing things directly on the db is not often a good idea. I would recommend doing them either via the admin or via a script/import.
But if you would like to do this via the database the following should do it for you.
UPDATE catalog_product_entity_int SET value = 1 WHERE attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = "visibility") AND entity_id in (ADD YOUR PRODUCT IDS HERE);