0

My checkout cart page doesn't show the product images, I checked the pub/media/catalog/product/cache folder and the image via browser inspector, but they are never the same as you can see in the image below.

I already removed all the third-party modules and my custom theme.

Magento2 checkout cart don't show the product image

I checked in the database and the route is right, just the generated cache folder is wrong. I changed this admin option too, but nothing changed.

Magento2 Configurable Product Image

The original code below gets the wrong image, but when I changed the cart_page_product_thumbnail to category_page_grid it worked.

<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>

How could I fix it?

1 Answer 1

1

I fixed it changing the cart_page_product_thumbnail to product_small_image

<?= $block->getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?>

You can check all the possibilities in this file:

vendor/magento/theme-frontend-luma/etc/view.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.