1
I have code below that pulls the images of the products of the shopping cart of the Gento, but it is displaying duplicate, IE, when it lists the images it displays twice the same image.
<?php
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems() ;
foreach($items as $item) {
echo '<img style="width: 75px; height: 75px;" src="'.$this->helper('catalog/image')->init($item->getProduct(), 'small_image').'"/>';
}
?>
I’d like to show off just once, end this loop.
Dude vlw by the help, but even so it didn’t work yet, it keeps doubling.
– jeann sebold
So the problem is before. When adding the product in the cart you need to add once only.
– Diego Souza
So I also thought about it, but it’s right, problem is that it just duplicating images, for example if it has a product it displays a single image and if it has two products it lists twice and if I have 3 products it will list 3 times.
– jeann sebold
Makes a
count($items)
under the$items
. It is to bring the quantity of products in the cart.– Diego Souza
Could you help me on how to make this Count
– jeann sebold
I’m having little trouble with that
– jeann sebold