Skip to content

Instantly share code, notes, and snippets.

@andrewdaluz
Created February 21, 2019 18:49
Show Gist options
  • Save andrewdaluz/b89dce2ec1ab33fad59e6df73cc25f93 to your computer and use it in GitHub Desktop.
Save andrewdaluz/b89dce2ec1ab33fad59e6df73cc25f93 to your computer and use it in GitHub Desktop.
Product images error for multi-store

Found the errors

SELECT `cpev_s`.*, `cpev_0`.`value` AS `store_value` FROM `catalog_product_entity_varchar` `cpev_s` JOIN `eav_attribute` `ea` ON `cpev_s`.`attribute_id` = `ea`.`attribute_id` LEFT JOIN `catalog_product_entity_varchar` `cpev_0` ON `cpev_0`.`entity_id` = `cpev_s`.`entity_id` AND `cpev_0`.`attribute_id` = `cpev_s`.`attribute_id` AND `cpev_0`.`store_id` = 0 WHERE `cpev_s`.`value` = 'no_selection' AND `ea`.`attribute_code` IN ('image', 'small_image', 'thumbnail') AND `cpev_s`.`store_id` > 0 AND `cpev_s`.`value` != `cpev_0`.`value` AND `cpev_s`.`value` = 'no_selection';

Delete the entries

DELETE `cpev_s`.* FROM `catalog_product_entity_varchar` `cpev_s` JOIN `eav_attribute` `ea` ON `cpev_s`.`attribute_id` = `ea`.`attribute_id` LEFT JOIN `catalog_product_entity_varchar` `cpev_0` ON `cpev_0`.`entity_id` = `cpev_s`.`entity_id` AND `cpev_0`.`attribute_id` = `cpev_s`.`attribute_id` AND `cpev_0`.`store_id` = 0 WHERE `cpev_s`.`value` = 'no_selection' AND `ea`.`attribute_code` IN ('image', 'small_image', 'thumbnail') AND `cpev_s`.`store_id` > 0 AND `cpev_s`.`value` != `cpev_0`.`value` AND `cpev_s`.`value` = 'no_selection';

https://support.magento.com/hc/en-us/articles/115002446014-Product-images-are-not-displayed-although-set-on-the-Product-Edit-page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment