While working on a WooCommerce website I encountered a strange error.
The product image and the gallery images were gone suddenly from the single product pages for some of the products that were on sale!
When I checked the product page with Chrome dev tools I could see that there were no product/gallery images added there.
At first, I thought it could be the cache issue. But nothing changed after clearing the cache too.
Then I tried removing the product image from the page and then adding it again. But that also had no effect.
Finally, I thought of duplicating the page and seeing if the error remains on the new page.
I duplicated the page but didn’t publish it. So I clicked on the preview and lo & behold the images appeared.
The next step was to publish the page and see if the images keep on displaying or not. They did.
So, I deleted the old page and renamed the slug of this new page to the older one.
Hence, I found the solution to this issue.
To just duplicate the page and publish it again. And rename the slug and the title of the new product page to the older one.