WooCommerce product gallery in dynamic slider with WP query string

Hi
I build a product single layout with cornerstone on a customers website.
I want to show the WooCommerce product gallery images in a slider.
The slider is in a component.
I have used this string:

post_type=attachment&post_mime_type=image&numberposts=-1&post_status=null&post_parent={{dc:post:id}}

But it works only for some products, unfortunately.
Since the images are attached to each of the products, it should work.
Hipe your can help.
Best regards,
Hannes

Hey Hannes,

Thanks for reaching out!

In order for us to investigate your issue properly, we need to check your setup. To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Here are the credentials.
It is a development site.
Thank you!

Hey @Salilou,

Can you please update your query string to: post_type=attachment&post_mime_type=image&post_parent={{dc:post:id}}?

Or you can also use: post_type=attachment&post_mime_type=image&posts_per_page=-1&post_status=any&post_parent={{dc:post:id}}

Kindly let us know how it goes.

Thank you, but still it does only work on some of them.
See my first secure note.

Hi @salilou,

The post_mime_type should be image/png or image/jpeg etc. So, you need to change it in your Query String.

Hope it helps.
Thanks

Thank you, but I tried the following:
Under WP Backend > Media I took a look at the images, that do not appear in the product gallery.
All of them were NOT linked to the product.
I linked them manually, now it works.
Why some of the images I uploaded as product gallery images to the product are linked to the product, and others are not.

Hi @salilou,

Glad that it worked. But, it will be difficult to recognize why the images are not linked to the product. There might be some other reason behind that.

Thanks

Thank you!

Hi @salilou,

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.