Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JoryHogeveen/7aa4fa8a859cb030319cd300cbc745b6 to your computer and use it in GitHub Desktop.
Save JoryHogeveen/7aa4fa8a859cb030319cd300cbc745b6 to your computer and use it in GitHub Desktop.
Magento 2 - Store view EAV - Reset same values to default
## 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