3

magento-1.9.2.4 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

2

Mysql: Magento save the relation between configurable product and it child products at catalog_product_super_link and save it product basic data at catalog_product_entity Table.

enter image description here

Write select query with select type_id=simple simple product and check that product id exit at catalog_product_super_link table product_id. columns.

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 Query:

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');
  • i will check at night – Amit Bera Jan 19 '17 at 15:02
1

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.