add_filter('webexpert_skroutz_xml_custom_gallery','webexpert_skroutz_xml_custom_gallery',10,2);
function webexpert_skroutz_xml_custom_gallery($gallery_image_ids,$product) {
if ( $product->is_type( 'variation' ) ) {
$colour=get_post_meta($product->get_id(), 'attribute_pa_'.esc_attr( get_option('we_skroutz_xml_colour')), true);
if ($colour) {
$gallery=get_post_meta($product->get_parent_id(),'_product_image_gallery_pa_'.esc_attr( get_option('we_skroutz_xml_colour').'-'.$colour,true));
if (is_array($gallery)) {
$gallery=end($gallery);
}
$expl=explode(",",$gallery);
array_shift($expl);
return $expl;
}
return [];
}else {
return $gallery_image_ids;
}
}
This is a filter of functions.php in hello elementor theme that i need to modify, so the additional images added in the Additional Variation Images Gallery for WooCommerce plugin, could show in the XML of WooCommerce Skroutz & BestPrice XML Feed.