Found this lovely piece of sql query code to excluded multiple images on magento.
UPDATE catalog_product_entity_media_gallery_value SET disabled = 0;
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 = 2) AS mg
SET mgv.disabled = 1
WHERE mgv.value_id = mg.value_id
I am looking to have this run as a cron job instead of direct with the database but have no idea how to write it up as one.
Can this be made into a cron job?
Point me in the right direction please.