Last active
December 24, 2024 12:24
-
-
Save JoryHogeveen/7aa4fa8a859cb030319cd300cbc745b6 to your computer and use it in GitHub Desktop.
Magento 2 - Store view EAV - Reset same values to default
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
## Run below code for the following tables: | |
## - catalog_product_entity_text | |
## - catalog_product_entity_datetime | |
## - catalog_product_entity_decimal | |
## - catalog_product_entity_int | |
## - catalog_product_entity_varchar | |
## 0 = default store | |
SELECT * ## Run test query | |
#DELETE s ## Run deletion | |
FROM catalog_product_entity_text s ##Change table name. | |
LEFT JOIN catalog_product_entity_text d ## Change table name to the same table as above. | |
ON ( | |
d.store_id = 0 | |
AND s.entity_id = d.entity_id | |
AND s.attribute_id = d.attribute_id | |
AND s.value = d.value | |
) | |
WHERE | |
#s.store_id IN (1,2,3,4,5) ## Set multiple store view IDs | |
#s.store_id = 2 ## OR Set single store view ID | |
AND d.store_id = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment