Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Floating a banner over product images in list.phtml
 
melvynanderson
Jr. Member
 
Total Posts:  20
Joined:  2012-12-24
 

So far I have this working about three quarters of the way.  The image floats over the products details rather than the image itself.

http://www.melvynanderson.com/royal-worcester.html?p=2

You can see an example of the output on the frontend here on the next to last row of items.

I know there is probably just something that needs to get moved around, but I’m not sure where to put it exactly.  Can anyone help with this?

Here is the section of code from my list.phtml file for the product view.

<?php // Grid Mode ?>

    
<?php $_collectionSize $_productCollection->count() ?>
    <?php $_columnCount 
$this->getColumnCount(); ?>
    <?php $i
=0; foreach ($_productCollection as $_product): ?>
<?php 
//get all categories associated with this product
$categories $_product->getCategoryIds(); 
$clearance_category 27//sold category id

if(in_array($clearance_category$categories)) {
    $soldtag
='<div class="sold-tag" style="position: relative; left: 0; top: 0;"><img src="http://www.melvynanderson.com/skin/frontend/default/fly/images/sold.png" style="position: absolute; top: 0; left: 0;"/></div>';
}
else {
    $soldtag
='';
}
?>
        <?php 
if ($i++%$_columnCount==0): ?>
             
<div class="mid-content-images">
        <
ul>
        
<?php endif ?>
          
<li>
               <
div class="banner-right-image">
            
<?php // Product Image ?>
            
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" ><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(200,160); ?>" width="200" height="160" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" border="0" class="image-effact" style="position: relative; top: 0; left: 0;" /><?php echo $soldtag ?></a>
            
<?php // Product description ?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top