Skip to content

Instantly share code, notes, and snippets.

@dfelton
Last active May 12, 2016 17:23
Show Gist options
  • Save dfelton/d29c8fef4227929a8a044b2e362bb363 to your computer and use it in GitHub Desktop.
Save dfelton/d29c8fef4227929a8a044b2e362bb363 to your computer and use it in GitHub Desktop.
Magento - Hide ALL simple products that are a child of a configurable product
UPDATE
`catalog_product_entity_int`
SET
`value` = '1'
WHERE
`attribute_id` = (
SELECT
`attribute_id`
FROM
`eav_attribute`
WHERE
`attribute_code` = 'visibility'
AND
`entity_type_id` = (
SELECT
`entity_type_id`
FROM
`eav_entity_type`
WHERE
`entity_type_code` = 'catalog_product'
)
)
AND
`entity_id` IN (
SELECT DISTINCT `product_id` FROM `catalog_product_super_link`
)
AND
`value` <> '1';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment