The script below shows how to remove the 2nd image from been displayed on hover
var __isp_options = {
image_rollover_filter: function (data) {
if ("images" in data.product) {
// get and array of image urls with fixed src
const images = data.product.images.map(image => fixRolloverImage(image.src));
// remove second image from url array
images.splice(1,1);
return images;
}
return [];
}
};
const fixRolloverImage = (url) => {
const result = url.replace('.JPG', '_large.JPG')
.replace('.jpeg', '_large.jpeg')
.replace('.jpg', '_large.jpg');
return _shopify_serp_image(result);
};