Blog

Product Image not display in the Caraousel or Slider Magento2

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:-

  1. Overrite the vendor\magento\module-page-builder\view\frontend\templates\catalog\product\widget\content\carousel.phtml file in your custom theme.
  2. 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 !!

One thought on “Product Image not display in the Caraousel or Slider Magento2

  1. 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.!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

πŸš€ Let’s Connect on LinkedIn! πŸš€

Want to level up your skills and knowledge? πŸš€
Follow us on LinkedIn to get:
βœ… Expert insights on business growth
βœ… Daily tips to sharpen your skills
βœ… Exclusive updates from The Coach SMB

Let's grow together!