开发者

Exclude main image from Magento product gallery

开发者 https://www.devze.com 2023-03-17 07:52 出处:网络
I need to update my database of products to mark the \"base\" image of every product as Excluded. Some products have 1 image, some have more than 1. In each case one image is marked as being the Base,

I need to update my database of products to mark the "base" image of every product as Excluded. Some products have 1 image, some have more than 1. In each case one image is marked as being the Base, Small and Th开发者_JS百科umb image. In every case, where an image is marked as such, I need it to be excluded from the gallery.

Currently, without it being excluded, that image will show up twice in the lightbox gallery (Magento 1.4.0.1).

Does someone know the database structure well enough to give me a mySQL solution to update this?

I can manage future new products easily enough, but there's no way I'm running through 22000 products manually! :-)

Thanks in advance!


The SQL to do this in Magento 1.4.0.1 is:

UPDATE `catalog_product_entity_media_gallery_value`
SET Disabled = 1
WHERE Position = 1

I agree that updating the gallery code would have been a good/better solution, but in my case I am easily able to keep on top of this as new products are added in future.


It is easier to update your gallery code to exclude the first image you also do not have an ongoing need to update the product images.

0

精彩评论

暂无评论...
验证码 换一张
取 消