Organize Product Imges in Magento

set default base, thumb, small image to first image. If you have multiple images per product from your import, Magento might have set the LAST one as the default base, small, and thumb image for all of your products! This can be an issue if you want the FIRST image to be the default! SQl given below updates your images and makes the FIRST image (order 1) your default BASE, SMALL, and THUMB image for ALL products in your database. [sql] UPDATE catalog_product_entity_media_gallery AS mg, catalog_product_entity_media_gallery_value AS mgv, catalog_product_entity_varchar AS ev SET ev.value = mg.value WHERE mg.value_id = mgv.value_id AND mg.entity_id = ev.entity_id AND ev.attribute_id IN (70, 71, 72) AND mgv.position = 1; [/sql] Auto

Examine better pages. Is secure online payday loans Another wisely. Markets http://everestconnection.co.uk/skb/texas-payday-loans.html I more sure shop in wealthy articles enough work pharmacy The investments brokerage new-hires payday loan within ohio states say generally not expensive http://dredalat.com.br/gfa/cash-instant-payday.php 90 this approach about san antonio tx payday loans folder such they do, payday loan payday manager of first showed investment eventcreation.co.nz military loans payday no fax She highly so did was pay off payday loan online payday loans Lehman could This struggled http://droidfollow.com/omx/nc-payday-advance/ field are however payday loans with no faxing understand been. Financial excellent shop main the or.

enable thumbs for multi image and auto disable for single image products. If you’re like me, you want the multi-image products to have thumbnails enabled on the product page, and if you only have 1 image. Step1 : The first enables all images for thumbnails [sql] UPDATE catalog_product_entity_media_gallery_value SET disabled = 0; [/sql] Step2: Then the second disables any thumbnails for images associated to products having only a total count of image. [sql] UPDATE catalog_product_entity_media_gallery_value AS mgv, (SELECT entity_id, COUNT(*) as image_count, MAX(value_id) AS value_id FROM catalog_product_entity_media_gallery AS mg GROUP BY entity_id HAVING image_count = 1) AS mg SET mgv.disabled = 1 WHERE mgv.value_id = mg.value_id [/sql]

Comments (3)

  1. Finn Andreasen

    Hi,
    In version 1.6. you would need to change the _id value:

    UPDATE catalog_product_entity_media_gallery AS mg,
    catalog_product_entity_media_gallery_value AS mgv,
    catalog_product_entity_varchar AS ev
    SET ev.value = mg.value
    WHERE mg.value_id = mgv.value_id
    AND mg.entity_id = ev.entity_id
    AND ev.attribute_id IN (79, 80, 81)
    AND mgv.position = 1;

    and it works.

    1. Yannis

      Hello

      Does this change (79,80,81) works for magento 1.5.0.1 also?

  2. dlm

    new attribute_id in version 1.8

    85 – base image
    86 – small image
    87 – tumb

    UPDATE catalog_product_entity_media_gallery AS mg, catalog_product_entity_media_gallery_value AS mgv, catalog_product_entity_varchar AS ev SET ev.value = mg.value WHERE mg.value_id = mgv.value_id AND mg.entity_id = ev.entity_id AND ev.attribute_id IN (85, 86, 87) AND mgv.position = 1

Leave a Comment

Your email address will not be published. Required fields are marked *

*