imagify-plugin icon indicating copy to clipboard operation
imagify-plugin copied to clipboard

First Product Image on Woocommerce Single Product Page Not Converting to Next-Gen with <picture> Tag

Open saranshj4 opened this issue 7 months ago • 2 comments

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version => 2.2.2
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug The first product image on the Woocommerce single product page does not convert to next-gen formats (WebP/AVIF) using the <picture> tag method. While other images, including those in the product gallery, are converted successfully, the first product image remains in its original format. The <img> tag is replaced with the <picture> tag, but it does not pull the next-gen version.

To Reproduce Steps to reproduce the behavior:

  1. Update to the latest versions of Woocommerce and Imagify.
  2. Enable next-gen image display in Imagify settings and select the <picture> tag method.
  3. Ensure next-gen versions are generated for all images.
  4. Navigate to a Woocommerce single product page.
  5. Observe that the first product image is not converted to next-gen format, while other images are.

Expected behavior The first product image should convert to next-gen formats using the <picture> tag method, similar to the other images on the page.

The workaround is to use the rewrite rules method to display next-gen seamlessly.

Screenshots image image

Additional context In my testing, I noticed that the gallery thumbnails (100x100) were not loading in next-gen formats. However, this was not the case in other user websites. image

Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming

saranshj4 avatar Jun 28 '24 08:06 saranshj4