Created
August 1, 2015 09:08
-
-
Save vpietri/ad2003a1e90ec275d8ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Desactive simple product which configurable product is deactivated | |
-- Replace %ATTRIBUTE_ID% with id of the eav product attribute "status" | |
UPDATE catalog_product_entity_int cpei_s | |
JOIN catalog_product_entity cpe ON cpe.entity_id=cpei_s.entity_id AND cpei_s.attribute_id=%ATTRIBUTE_ID% AND cpei_s.store_id=0 AND cpei_s.value=1 | |
JOIN `catalog_product_super_link` spsl ON spsl.product_id=cpe.entity_id | |
JOIN catalog_product_entity_int cpei ON spsl.parent_id=cpei.entity_id AND cpei.attribute_id=%ATTRIBUTE_ID% AND cpei.store_id=0 AND cpei.value=2 | |
SET cpei_s.value=2 | |
WHERE cpe.type_id='simple'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment