fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Retrieving product variation images with the WC_Product_Variation object

Ricky Attard

I am trying to retrieve the variation product gallery images to another function. Is there a simple way of doing this?

Rezwan Shiblu

Hi there,

Thanks for reaching out to us.

Could you tell us that actually what you want to do after retrieving additional variation images?

If there have any possibilities, I will let you know after discussing it with our development team.

Thank you.

 

Ricky Attard

I am outputting to a PDF, so I need to be able to retrieve in a function. Short of doing an SQL query, I haven’t discovered a way.

Rezwan Shiblu

Hi there,

I will let you know after discussing it with our development team.

Thank you.

Hakik Zaman

Hi Ricky,

We just keep the image id in woo_variation_gallery_images post meta.

Using the product id, you can retrieve the image ids.

Here is a screenshot- https://paste.pics/KNSPU for your convenience.

I hope this explanation will help.

Thank You