2

How to align all View Details buttons inline on all category pages. I think i have to fix the names of all products, if this is fixed then all the View Details buttons get aligned inline. I don't know how to do this. I am not familiar with CSS. My website is mobile friendly & responsive. How to fix this issue. For better understanding I had uploaded the screenshot.

list.phtml

    <?php
/**
 */
?>
<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
/* @var $this Mage_Catalog_Block_Product_List */
?>
<?php
    /* Count for timer calculation declared here */
    $count = 1;
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="category-products">
    <?php echo $this->getToolbarHtml() ?>
    <?php // List mode ?>
    <?php if($this->getMode()!='grid'): ?>
    <?php $_iterator = 0; ?>
    <ol class="products-list" id="products-list">
    <?php foreach ($_productCollection as $_product): ?>
        <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
            <?php // Product Image ?>
            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
                <?php /* Based on the native RWD styling, product images are displayed at a max of ~400px wide when viewed on a
                        one column page layout with four product columns from a 1280px viewport. For bandwidth reasons,
                        we are going to serve a 300px image, as it will look fine at 400px and most of the times, the image
                        will be displayed at a smaller size (eg, if two column are being used or viewport is smaller than 1280px).
                        This $_imgSize value could even be decreased further, based on the page layout
                        (one column, two column, three column) and number of product columns. */ ?>
                <?php $_imgSize = 300; ?>
                <img id="product-collection-image-<?php echo $_product->getId(); ?>"
                     src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
                     alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
            </a>
            <?php // Product description ?>
            <div class="product-shop">
                <div class="f-fix">
                    <div class="product-primary">
                        <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
                        <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
                        <?php if($_product->getRatingSummary()): ?>
                        <?php echo $this->getReviewsSummaryHtml($_product) ?>
                        <?php endif; ?>

                        <?php
                            $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
                            foreach($_nameAfterChildren as $_nameAfterChildName):
                                $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
                                $_nameAfterChild->setProduct($_product);
                        ?>
                            <?php echo $_nameAfterChild->toHtml(); ?>
                        <?php endforeach; ?>
                    </div>
                    <div class="product-secondary">
                        <?php echo $this->getPriceHtml($_product, true) ?>
                    </div>
                    <!--Condition for Timer Controllers goes here-->
                    <?php if($this->getPriceCountDown($_product)) :?>
                        <?php if (Mage::helper('timer')->isShowTitle('listpage')): ?>
                            <div id="heading<?php echo $count; ?>"  class="timer-heading" style="font-size: 14px; font-weight:bold;padding-top:0px;clear: both;">
                                <?php echo Mage::helper('timer')->getTimerTitle(); ?>
                            </div>
                        <?php endif; ?>
                        <div id="countbox_<?php echo $count; ?>" class="timer-list"></div>
                        <?php if (Mage::helper('timer')->isShowCaption('listpage')): ?>
                            <div class='clear'></div>
                            <div class='timerdate' id="caption<?php echo $count; ?>">
                                <span class='hour' style='margin:0'><?php echo $this->__('D') ?></span>
                                <span class='hour' style='margin:0 0 0 25px'><?php echo $this->__('H') ?></span>
                                <span class='min'  style='margin:0 0 0 22px'><?php echo $this->__('M') ?></span>
                                <span class='sec' style='margin:0 0 0 23px'><?php echo $this->__('S') ?></span>
                            </div>
                        <?php endif;?>
                    <?php endif; ?>
                    <!--Condition for Timer Controllers End -->
                    <div class="product-secondary">
                        <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
                            <p class="action"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
                        <?php elseif($_product->isSaleable()): ?>
                            <p class="action"><a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
                        <?php else: ?>
                            <p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                        <?php endif; ?>
                        <ul class="add-to-links">
                            <?php if ($this->helper('wishlist')->isAllow()) : ?>
                                <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                            <?php endif; ?>
                            <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                                <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
                            <?php endif; ?>
                        </ul>
                    </div>
                    <div class="desc std">
                        <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
                        <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
                    </div>
                </div>
            </div>
            <?php if($this->getPriceCountDown($_product)) :?>
                <?php $toDate = $_product->getSpecialTODate();?>
                <script type="text/javascript">
                    var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
                    start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
                    start_date = Date.parse(start);
                    var dnow<?php echo $count; ?> = new Date(start_date);
                    if(CountStepper>0)
                    ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
                    else
                    ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
                    gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
                    var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
                    CountBack(gsecs<?php echo $count; ?>,"countbox_"+timer, timer);
                    timer++;
                </script>
                <?php $count = $count + 1; ?>
            <?php endif;?>
        </li>
    <?php endforeach; ?>
    </ol>
    <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>

    <?php else: ?>

    <?php // Grid Mode ?>

    <?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
    <?php if ($i++%$_columnCount==0): ?>
    <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
    <?php endif ?>
            <?php /*if ($i++%$_columnCount==0): ?>
            <?php endif*/ ?>
            <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
                <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
                    <?php $_imgSize = 210; ?>
                    <img id="product-collection-image-<?php echo $_product->getId(); ?>"
                         src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
                         alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
                </a>
                <div class="product-info">
                    <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>

                    <?php
                        $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
                        foreach($_nameAfterChildren as $_nameAfterChildName):
                            $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
                            $_nameAfterChild->setProduct($_product);
                    ?>
                        <?php echo $_nameAfterChild->toHtml(); ?>
                    <?php endforeach; ?>

                    <?php echo $this->getPriceHtml($_product, true) ?>
                    <!--Condition for Timer Controllers goes here-->
                    <?php if($this->getPriceCountDown($_product)) :?>
                        <?php if (Mage::helper('timer')->isShowTitle('listpage')): ?>
                            <div id="heading<?php echo $count; ?>" class="timer-heading" style="font-size: 14px; font-weight:bold;padding-top:0px;clear: both;">
                                <?php echo Mage::helper('timer')->getTimerTitle(); ?>
                            </div>
                        <?php endif; ?>
                        <div id="countbox_<?php echo $count; ?>" class="timer-list"></div>
                        <?php if (Mage::helper('timer')->isShowCaption('listpage')): ?>
                            <div class='clear'></div>
                            <div class='timerdate' id="caption<?php echo $count; ?>">
                                <span class='hour' style='margin:0'><?php echo $this->__('D') ?></span>
                                <span class='hour' style='margin:0 0 0 25px'><?php echo $this->__('H') ?></span>
                                <span class='min'  style='margin:0 0 0 20px'><?php echo $this->__('M') ?></span>
                                <span class='sec' style='margin:0 0 0 23px'><?php echo $this->__('S') ?></span>
                            </div>
                        <?php endif;?>
                    <?php endif; ?>
                    <!--Condition for Timer Controllers End -->
                    <?php if($_product->getRatingSummary()): ?>
                    <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                    <?php endif; ?>
                    <div class="actions">
                        <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
                                 <button type="button" title="<?php echo $this->__('View Details') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getProductUrl($_product) ?>')"><span><span><?php echo $this->__('View Details') ?></span></span></button>
                        <?php elseif($_product->isSaleable()): ?>
                            <a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
                        <?php else: ?>
                            <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                        <?php endif; ?>
                        <ul class="add-to-links">
                            <?php if ($this->helper('wishlist')->isAllow()) : ?>
                                <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                            <?php endif; ?>
                            <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                                <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
                            <?php endif; ?>
                        </ul>
                    </div>
                </div>
                   <?php if($this->getPriceCountDown($_product)) :?>
                    <?php $toDate = $_product->getSpecialTODate();?>
                    <script type="text/javascript">
                        var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
                        start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
                        start_date = Date.parse(start);
                        var dnow<?php echo $count; ?> = new Date(start_date);
                        if(CountStepper>0)
                            ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
                        else
                            ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
                        gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
                        var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
                        CountBack(gsecs<?php echo $count; ?>,"countbox_"+timer, timer);
                        timer++;
                    </script>
                    <?php $count = $count + 1; ?>
                    <?php endif;?>
            </li>
      <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
        </ul>
    <?php endif ?>
    <?php endforeach ?>
    <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
    <?php endif; ?>

    <div class="toolbar-bottom">
        <?php echo $this->getToolbarHtml() ?>
    </div>
</div>
<?php endif; ?>

<?php
    //set product collection on after blocks
    $_afterChildren = $this->getChild('after')->getSortedChildren();
    foreach($_afterChildren as $_afterChildName):
        $_afterChild = $this->getChild('after')->getChild($_afterChildName);
        $_afterChild->setProductCollection($_productCollection);
    ?>
    <?php echo $_afterChild->toHtml(); ?>
<?php endforeach; ?>

<!--  Timer Script Start here -->
<?php 
/* Admin Controllers for timer are declared here */
$timer_color = Mage::getStoreConfig('timer/apptha_timer_color/text');
$desc_color = Mage::getStoreConfig('timer/apptha_timer_color/description');
$head_color = Mage::getStoreConfig('timer/apptha_timer_color/heading_text_color');
?>

<!--  Timer Script End here -->
<!--Dynamic style changes goes here-->
<style>
.timer-list{float: left;width: 100%;padding: 0;color: #<?php echo $timer_color; ?>;font-size: 18px;font-family:arial;font-weight: bold;}
.timerdate{float: left;width: 100%;padding:0 0 3px 0;color: #<?php echo $desc_color; ?>;font-size: 12px;}
.timer-heading{color:#<?php echo $head_color;?>;}
</style>
  • The issue is due to your products name. You can trim it to fit into two lines. – Jaimin Sutariya May 28 '17 at 16:31
  • how to trim this @Jaimin – Salman Dalal May 28 '17 at 17:04
  • You can use substr function to achieve this. – Jaimin Sutariya May 28 '17 at 17:23
  • can you please provide the code – Salman Dalal May 28 '17 at 17:36
  • Can you please add your catalog/product/list.phtml code to question? – Jaimin Sutariya May 28 '17 at 17:41
3

Use below code for your list.phtml

<?php
/**
 */
?>
<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
/* @var $this Mage_Catalog_Block_Product_List */
?>
<?php
    /* Count for timer calculation declared here */
    $count = 1;
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="category-products">
    <?php echo $this->getToolbarHtml() ?>
    <?php // List mode ?>
    <?php if($this->getMode()!='grid'): ?>
    <?php $_iterator = 0; ?>
    <ol class="products-list" id="products-list">
    <?php foreach ($_productCollection as $_product): ?>
        <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
            <?php // Product Image ?>
            <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
                <?php /* Based on the native RWD styling, product images are displayed at a max of ~400px wide when viewed on a
                        one column page layout with four product columns from a 1280px viewport. For bandwidth reasons,
                        we are going to serve a 300px image, as it will look fine at 400px and most of the times, the image
                        will be displayed at a smaller size (eg, if two column are being used or viewport is smaller than 1280px).
                        This $_imgSize value could even be decreased further, based on the page layout
                        (one column, two column, three column) and number of product columns. */ ?>
                <?php $_imgSize = 300; ?>
                <img id="product-collection-image-<?php echo $_product->getId(); ?>"
                     src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($_imgSize); ?>"
                     alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
            </a>
            <?php // Product description ?>
            <div class="product-shop">
                <div class="f-fix">
                    <div class="product-primary">
                        <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
                        <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo mb_strimwidth($_helper->productAttribute($_product, $_product->getName(), 'name'), 0, 25, '...')?></a></h2>
                        <?php if($_product->getRatingSummary()): ?>
                        <?php echo $this->getReviewsSummaryHtml($_product) ?>
                        <?php endif; ?>

                        <?php
                            $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
                            foreach($_nameAfterChildren as $_nameAfterChildName):
                                $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
                                $_nameAfterChild->setProduct($_product);
                        ?>
                            <?php echo $_nameAfterChild->toHtml(); ?>
                        <?php endforeach; ?>
                    </div>
                    <div class="product-secondary">
                        <?php echo $this->getPriceHtml($_product, true) ?>
                    </div>
                    <!--Condition for Timer Controllers goes here-->
                    <?php if($this->getPriceCountDown($_product)) :?>
                        <?php if (Mage::helper('timer')->isShowTitle('listpage')): ?>
                            <div id="heading<?php echo $count; ?>"  class="timer-heading" style="font-size: 14px; font-weight:bold;padding-top:0px;clear: both;">
                                <?php echo Mage::helper('timer')->getTimerTitle(); ?>
                            </div>
                        <?php endif; ?>
                        <div id="countbox_<?php echo $count; ?>" class="timer-list"></div>
                        <?php if (Mage::helper('timer')->isShowCaption('listpage')): ?>
                            <div class='clear'></div>
                            <div class='timerdate' id="caption<?php echo $count; ?>">
                                <span class='hour' style='margin:0'><?php echo $this->__('D') ?></span>
                                <span class='hour' style='margin:0 0 0 25px'><?php echo $this->__('H') ?></span>
                                <span class='min'  style='margin:0 0 0 22px'><?php echo $this->__('M') ?></span>
                                <span class='sec' style='margin:0 0 0 23px'><?php echo $this->__('S') ?></span>
                            </div>
                        <?php endif;?>
                    <?php endif; ?>
                    <!--Condition for Timer Controllers End -->
                    <div class="product-secondary">
                        <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
                            <p class="action"><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p>
                        <?php elseif($_product->isSaleable()): ?>
                            <p class="action"><a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a></p>
                        <?php else: ?>
                            <p class="action availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                        <?php endif; ?>
                        <ul class="add-to-links">
                            <?php if ($this->helper('wishlist')->isAllow()) : ?>
                                <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                            <?php endif; ?>
                            <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                                <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
                            <?php endif; ?>
                        </ul>
                    </div>
                    <div class="desc std">
                        <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
                        <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a>
                    </div>
                </div>
            </div>
            <?php if($this->getPriceCountDown($_product)) :?>
                <?php $toDate = $_product->getSpecialTODate();?>
                <script type="text/javascript">
                    var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
                    start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
                    start_date = Date.parse(start);
                    var dnow<?php echo $count; ?> = new Date(start_date);
                    if(CountStepper>0)
                    ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
                    else
                    ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
                    gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
                    var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
                    CountBack(gsecs<?php echo $count; ?>,"countbox_"+timer, timer);
                    timer++;
                </script>
                <?php $count = $count + 1; ?>
            <?php endif;?>
        </li>
    <?php endforeach; ?>
    </ol>
    <script type="text/javascript">decorateList('products-list', 'none-recursive')</script>

    <?php else: ?>

    <?php // Grid Mode ?>

    <?php $_collectionSize = $_productCollection->count() ?>
    <?php $_columnCount = $this->getColumnCount(); ?>
    <?php $i=0; foreach ($_productCollection as $_product): ?>
    <?php if ($i++%$_columnCount==0): ?>
    <ul class="products-grid products-grid--max-<?php echo $_columnCount; ?>-col">
    <?php endif ?>
            <?php /*if ($i++%$_columnCount==0): ?>
            <?php endif*/ ?>
            <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
                <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image">
                    <?php $_imgSize = 210; ?>
                    <img id="product-collection-image-<?php echo $_product->getId(); ?>"
                         src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize($_imgSize); ?>"
                         alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
                </a>
                <div class="product-info">
                    <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo mb_strimwidth($_helper->productAttribute($_product, $_product->getName(), 'name'), 0, 25, '...')?></a></h2>

                    <?php
                        $_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
                        foreach($_nameAfterChildren as $_nameAfterChildName):
                            $_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
                            $_nameAfterChild->setProduct($_product);
                    ?>
                        <?php echo $_nameAfterChild->toHtml(); ?>
                    <?php endforeach; ?>

                    <?php echo $this->getPriceHtml($_product, true) ?>
                    <!--Condition for Timer Controllers goes here-->
                    <?php if($this->getPriceCountDown($_product)) :?>
                        <?php if (Mage::helper('timer')->isShowTitle('listpage')): ?>
                            <div id="heading<?php echo $count; ?>" class="timer-heading" style="font-size: 14px; font-weight:bold;padding-top:0px;clear: both;">
                                <?php echo Mage::helper('timer')->getTimerTitle(); ?>
                            </div>
                        <?php endif; ?>
                        <div id="countbox_<?php echo $count; ?>" class="timer-list"></div>
                        <?php if (Mage::helper('timer')->isShowCaption('listpage')): ?>
                            <div class='clear'></div>
                            <div class='timerdate' id="caption<?php echo $count; ?>">
                                <span class='hour' style='margin:0'><?php echo $this->__('D') ?></span>
                                <span class='hour' style='margin:0 0 0 25px'><?php echo $this->__('H') ?></span>
                                <span class='min'  style='margin:0 0 0 20px'><?php echo $this->__('M') ?></span>
                                <span class='sec' style='margin:0 0 0 23px'><?php echo $this->__('S') ?></span>
                            </div>
                        <?php endif;?>
                    <?php endif; ?>
                    <!--Condition for Timer Controllers End -->
                    <?php if($_product->getRatingSummary()): ?>
                    <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                    <?php endif; ?>
                    <div class="actions">
                        <?php if($_product->isSaleable() && !$_product->canConfigure()): ?>
                                 <button type="button" title="<?php echo $this->__('View Details') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getProductUrl($_product) ?>')"><span><span><?php echo $this->__('View Details') ?></span></span></button>
                        <?php elseif($_product->isSaleable()): ?>
                            <a title="<?php echo $this->__('View Details') ?>" class="button" href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->__('View Details') ?></a>
                        <?php else: ?>
                            <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                        <?php endif; ?>
                        <ul class="add-to-links">
                            <?php if ($this->helper('wishlist')->isAllow()) : ?>
                                <li><a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a></li>
                            <?php endif; ?>
                            <?php if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                                <li><span class="separator">|</span> <a href="<?php echo $_compareUrl ?>" class="link-compare"><?php echo $this->__('Add to Compare') ?></a></li>
                            <?php endif; ?>
                        </ul>
                    </div>
                </div>
                   <?php if($this->getPriceCountDown($_product)) :?>
                    <?php $toDate = $_product->getSpecialTODate();?>
                    <script type="text/javascript">
                        var dthen<?php echo $count; ?> = new Date("<?php echo Date("m/d/y", strtotime($toDate)).' 11:59:00 PM'; ?>");
                        start = "<?php echo Date("m/d/y h:i:s A", strtotime(Mage_Core_Model_Locale::date(null, null, "en_US", true))); ?>";
                        start_date = Date.parse(start);
                        var dnow<?php echo $count; ?> = new Date(start_date);
                        if(CountStepper>0)
                            ddiff= new Date((dnow<?php echo $count; ?>)-(dthen<?php echo $count; ?>));
                        else
                            ddiff = new Date((dthen<?php echo $count; ?>)-(dnow<?php echo $count; ?>));
                        gsecs<?php echo $count; ?> = Math.floor(ddiff.valueOf()/1000);
                        var iid<?php echo $count; ?> = "countbox_<?php echo $count; ?>";
                        CountBack(gsecs<?php echo $count; ?>,"countbox_"+timer, timer);
                        timer++;
                    </script>
                    <?php $count = $count + 1; ?>
                    <?php endif;?>
            </li>
      <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
        </ul>
    <?php endif ?>
    <?php endforeach ?>
    <script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
    <?php endif; ?>

    <div class="toolbar-bottom">
        <?php echo $this->getToolbarHtml() ?>
    </div>
</div>
<?php endif; ?>

<?php
    //set product collection on after blocks
    $_afterChildren = $this->getChild('after')->getSortedChildren();
    foreach($_afterChildren as $_afterChildName):
        $_afterChild = $this->getChild('after')->getChild($_afterChildName);
        $_afterChild->setProductCollection($_productCollection);
    ?>
    <?php echo $_afterChild->toHtml(); ?>
<?php endforeach; ?>

<!--  Timer Script Start here -->
<?php 
/* Admin Controllers for timer are declared here */
$timer_color = Mage::getStoreConfig('timer/apptha_timer_color/text');
$desc_color = Mage::getStoreConfig('timer/apptha_timer_color/description');
$head_color = Mage::getStoreConfig('timer/apptha_timer_color/heading_text_color');
?>

<!--  Timer Script End here -->
<!--Dynamic style changes goes here-->
<style>
.timer-list{float: left;width: 100%;padding: 0;color: #<?php echo $timer_color; ?>;font-size: 18px;font-family:arial;font-weight: bold;}
.timerdate{float: left;width: 100%;padding:0 0 3px 0;color: #<?php echo $desc_color; ?>;font-size: 12px;}
.timer-heading{color:#<?php echo $head_color;?>;}
.product-name{ min-height:40px !important; } 
.price { font-size:15px !important; }
</style>
| improve this answer | |
  • I had used your code but still the View Details button are not getting aligned – Salman Dalal May 28 '17 at 18:01
  • Can you see ... After your products names? – Jaimin Sutariya May 28 '17 at 18:34
  • NO nothing has changed @Jaimin – Salman Dalal May 28 '17 at 18:36
  • There are two instances of this line in your list.phtml. Please replace both of them – Jaimin Sutariya May 29 '17 at 1:17
  • Okzz i will check n get back to u – Salman Dalal May 29 '17 at 6:38

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.