Skip to content
Advertisement

How to show all images in WooCommerce product description

I want to replace my product description by my description + all product images (include variation product images) in single product page.

I can do that with Magento but now when change to Woocommerce I can not.

After research I tried with filter hook but not success.

I can add text to product decscription but I am stucking how to using functions wp_get_attachment_image_url() or wp_get_attachment_image().

Sample code for display image as I know:

JavaScript

How to apply in my code?

JavaScript

Advertisement

Answer

You can use the WC_Product get_image() method like:

JavaScript

Then in your code you can buffer all echoed custom code plus the main product image (at the end of your product description content) as follow:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement