For the purpose of a product image flipper, I want to display the second image from the variation images for each product.

I’m using the WooCommerce Additional Variation Images plugin and I don’t know how to get that image.

I tried this

$product->wp_get_attachment_image_src( $id )

but it returns the following : Call to undefined method WC_Product_Variation::wp_get_attachment_image_src() in…

Anyone who is familiar with this plugin could help me ? If you need more information let me know.

Thanks !

Read more here: Woocommerce additionnal variation images – How to display the second image


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: