4

After lots of try finally I manage to import bulk of products in magento.

Now How I can do get SKU of product if:

  1. products without images.

OR

  1. Images without lable.

Thanks in advance

1 Answer 1

4

The images are stored in the table catalog_product_entity_media_gallery. You can get all the products that have images like this:

SELECT DISTINCT(entity_id) from catalog_product_entity_media_gallery;

You can get the product ids without images like this:

SELECT entity_id from catalog_product_entity where entity_id NOT IN (SELECT DISTINCT(entity_id) from catalog_product_entity_media_gallery);

The labels of the images are stored in catalog_product_entity_media_gallery_value. You can get the products with images without labels by checking the field label in that table.

3
  • Thanks man, really great help. For label value_id refer to catalog_product_entity_media_gallery.value_id and then you will get corresponding entity_id.
    – Sandesh
    Jun 17, 2013 at 19:09
  • Tables were changed for later version so on Magento 2.3.7 the query looks like this: SELECT entity_id from catalog_product_entity where entity_id NOT IN (SELECT DISTINCT(entity_id) from catalog_product_entity_media_gallery_value_to_entity);
    – Jacques
    Sep 27, 2021 at 12:59
  • For Magento 2.4.X: SELECT entity_id from catalog_product_entity where entity_id NOT IN (SELECT DISTINCT(value_id) from catalog_product_entity_media_gallery_value_to_entity);
    – J Harvey
    Feb 10 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.