• Resolved jviure

    (@jviure)


    Hi, through code, can I get the gallery images through the varation_id of a variable product? I tried like $variation->get_gallery_image_ids() with no luck. Some hint? thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author RadiusTheme

    (@techlabpro1)

    Hi,
    Our variation images are saving in specific meta key “rtwpvg_images”, You can get variation images by variation id like this.

    
    $variation_id = absint($variation->ID);
    $gallery_images = get_post_meta($variation_id, 'rtwpvg_images', true); 
    if (is_array($gallery_images) && !empty($gallery_images)) {
        foreach ($gallery_images as $image_id):
            $image = wp_get_attachment_image_src($image_id);
            //image url
            echo $image[0];
        endforeach;
    }

    Try this code

    Thanks

    Thread Starter jviure

    (@jviure)

    oohh, great! many thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘code, get gallery images’ is closed to new replies.