add_filter(‘webexpert_skroutz_xml_custom_gallery’,’webexpert_skroutz_xml_custom_gallery’,10,3);
function webexpert_skroutz_xml_custom_gallery($gallery_image_ids, $variation_id, $product) {
if ($product->is_type(‘variation’)) {
$colour = get_post_meta($variation_id, ‘attribute_pa_’ . esc_attr(get_option(‘we_skroutz_xml_colour’)), true);
if ($colour) {
$gallery = get_post_meta($product->get_parent_id(), ‘woo_variation_gallery_images_’ . $variation_id, true);
if ($gallery) {
$expl = explode(“,”, $gallery);
return $expl;
}
}
return [];
} else {
return $gallery_image_ids;
}
}
something like this is ok?