Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save victordit/575aa58075e1a0e8ca96edb31bae0e0b to your computer and use it in GitHub Desktop.
Save victordit/575aa58075e1a0e8ca96edb31bae0e0b to your computer and use it in GitHub Desktop.
-- Search products descriptions
SELECT
cpe.entity_id,
cpe.sku,
cs.name as store,
cpet_d.value as description,
cpet_sd.value as short_description
FROM `catalog_product_entity` as cpe
LEFT JOIN `eav_attribute` as ea
ON ea.attribute_code = 'description' AND ea.entity_type_id = 4
OR ea.attribute_code = 'short_description' AND ea.entity_type_id = 4
LEFT JOIN `catalog_product_entity_text` as cpet_d
ON cpe.entity_id = cpet_d.entity_id
AND cpet_d.attribute_id = ea.attribute_id
AND ea.attribute_code = 'description'
LEFT JOIN `catalog_product_entity_text` as cpet_sd
ON cpe.entity_id = cpet_sd.entity_id
AND cpet_sd.attribute_id = ea.attribute_id
AND ea.attribute_code = 'short_description'
LEFT JOIN `core_store` as cs
ON cpet_d.store_id = cs.store_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment