Are you facing issue of product image not displaying in the Slider or Caraousel in Magento2?
One of the possible reason could be that product image path shows %5C instead of /. To fix this, I have following solutions:-
- Overrite the vendor\magento\module-page-builder\view\frontend\templates\catalog\product\widget\content\carousel.phtml file in your custom theme.
- Replace the line
<?= $block->getImage($_item, $image)->toHtml() ?>
with
<img src="<?php echo $_item->getMediaConfig()->getMediaUrl($_item->getImage()) ?>" loading="lazy" width="240px" height="240px" />
Then Clear cache. Refresh the Page, you will see the product images on the Page.
That’s it !!
Mam, these solution was very helpful for me, i literally frustrated to find the solution for these but finally your blog helped me a lot from day 1. i really appreciate your work. looking for more.! thanks a lot.!!!
Keep it UP.!!!