2

I'm unable to see my product thumbnails on the cart page when I use Chrome or Safari. They do however appear in Firefox. The line rendering these images is in app/design/frontend/my_package/my_theme/template/checkout/cart/item/default.phtml

<td><?php if ($this->hasProductUrl()):?><a href="<?php echo $this->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" class="product-image"><?php endif;?><img src="<?php echo Mage::helper('catalog/image')->init($_product, 'small_image')->resize(75,75); ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" /><?php if ($this->hasProductUrl()):?></a><?php endif;?></td>

Despite being sized at 75px X 75px, the image is rendered in the browser at 0px X 75px, making it invisible. Inspecting the code shows that it is indeed there, it's just the wrong size. My first thought was an issue with class="product-image", but removing the class didn't change the output.

enter image description here

I've also tried a couple different ways of pulling up the image, all of which give the exact same result - a 0px X 75px image:

$_product = $_item->getProduct();
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image') ?>" width="75" height="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" />

Any ideas what might solve this issue?

1

Its css issue

You just need to give width to the "th" of the image "td". JUST ADD IT IN YOUR CSS WITH PROPER FORMATION LIKE:

table#shopping-cart-table > thead > tr > th:first-child {
    min-width: 100px;
}

check screenshot enter image description here

1

Add this CSS

table#shopping-cart-table > thead > tr > th:first-child {
    min-width: 96px;
}

I don't know the exact issue. But we can fix this issue by the above style.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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