Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
New Products grid shows 4 columns after upgrade to 1.4.0.1
 
oldboy
Sr. Member
 
Total Posts:  79
Joined:  2008-08-12
 

After upgrade the New Products shows 4 colums grid.
I cant find a way to remove the empty column.

The code for The New Product new.phtml file is:
/app/design/frontend/base/default/template/catalog/product/new.phtml

?>
<?php 
if (($_products $this->getProductCollection()) && $_products->getSize()): ?>
<h2 class="subtitle"><?php echo $this->__('New Products'?></h2>
<?php $_columnCount $this->getColumnCount(); ?>
    <?php $i
=0; foreach ($_products->getItems() as $_product): ?>
        <?php 
if ($i++%$_columnCount==0): ?>
        
<ul class="products-grid">
        
<?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->htmlEscape($_product->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135) ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /></a>
                <
h3 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h3>
                
<?php echo $this->getReviewsSummaryHtml($_product'short'?>
                <?php 
echo $this->getPriceHtml($_producttrue'-new'?>
                
<div class="actions">
                    
<?php if($_product->isSaleable()): ?>
                        
<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>
                    
<?php else: ?>
                        
<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->getAddToWishlistUrl($_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>
            </
li>
        
<?php if ($i%$_columnCount==|| $i==count($_products)): ?>
        
</ul>
        
<?php endif ?>
    <?php 
endforeach; ?>
<?php 
endif; ?>

But i cant figure out how to change the columns, anyone?

http://i39.tinypic.com/9kcjly.jpg

Image Attachments
screenshot.20.gif
 Signature 

Running version: 1.4.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bill007
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2008-01-15
New Zealand
 

Have you tried

Logging into the Back end Administration

go >>System >> Configuration >> Catalog
I recall some grid configurations in there

 Signature 


yoga videos |
Chicken coop plans New Zealand Accommodation[url=http://www.newplymouthmotel.co.nz]New Plymouth Accommodation
New Zealand Motels

 
Magento Community Magento Community
Magento Community
Magento Community
 
oldboy
Sr. Member
 
Total Posts:  79
Joined:  2008-08-12
 
Bill007 - 29 March 2010 01:30 AM

Have you tried

Logging into the Back end Administration

go >>System >> Configuration >> Catalog
I recall some grid configurations in there

Thanks but these grid settings are for product listing in catalog not the block on front page.
New Products is a separate block and i cant find a way to remove the extra column.

 Signature 

Running version: 1.4.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bill007
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2008-01-15
New Zealand
 

OK oldboy

I see your problem I think that phtml file is a red hearing.

Head into layout/calalog.xml kinda makes sense the directory is called Layout

When I look at the calalog.xml file i see this Below for some reason your pulling in the wrong hook
this is the Default Hook Call <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>

But you are pulling this hook
<action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>

I reckon this could do it

although just an after thought is there some setting in the back end that is activating this 4 column hook call instead of the 3

<!--
Category default layout
-->

    <
catalog_category_default translate="label">
        <
label>Catalog Category (Non-Anchor)</label>
        <
reference name="left">
            <
block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </
reference>
        <
reference name="content">
            <
block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
                <
block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
                    <
block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                        <
block type="page/html_pager" name="product_list_toolbar_pager"/>
                        <!-- 
The following code shows how to set your own pager increments -->
                        <!--
                            <
action method="setDefaultListPerPage"><limit>4</limit></action>
                            <
action method="setDefaultGridPerPage"><limit>9</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>2</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>4</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>6</limit></action>
                            <
action method="addPagerLimit"><mode>list</mode><limit>8</limit></action>
                            <
action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
                        -->
                    </
block>
                    <
action method="addColumnCountLayoutDepend"><layout>empty</layout><count>6</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>4</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>4</count></action>
                    <
action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>3</count></action>
                    <
action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                </
block>
            </
block>
        </
reference>
    </
catalog_category_default>

Good Luck Let me know the outcome

 Signature 


yoga videos |
Chicken coop plans New Zealand Accommodation[url=http://www.newplymouthmotel.co.nz]New Plymouth Accommodation
New Zealand Motels

 
Magento Community Magento Community
Magento Community
Magento Community
 
oldboy
Sr. Member
 
Total Posts:  79
Joined:  2008-08-12
 

Thanks again for trying.

My home page/front page is set to “2 columns with right bar “ in CMS/Pages

so changed the “two_columns_right” value to 3 in:
app/design/frontend/base/default/layout/catalog.xml

But it still shows 4 columns for New Products block on front page…

How does the php command in new.phtml get the column count?
<?php $_columnCount = $this->getColumnCount(); ?>

 Signature 

Running version: 1.4.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bill007
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2008-01-15
New Zealand
 

When I look at the image you provide I see a 3 column layout?

My home page/front page is set to “2 columns with right bar “ in CMS/Pages

How does the php command in new.phtml get the column count?
<?php $_columnCount = $this->getColumnCount(); ?>

I’m sure its pulling from the xml file

Now Have you disabled the cache in the back end

System >> Cache Management

Disable every thing and flush all your options have a good look around to make sure

also have gone into

CMS >> Home Page >> Design

Under lay out choose the layout for you

You will get there

 Signature 


yoga videos |
Chicken coop plans New Zealand Accommodation[url=http://www.newplymouthmotel.co.nz]New Plymouth Accommodation
New Zealand Motels

 
Magento Community Magento Community
Magento Community
Magento Community
 
oldboy
Sr. Member
 
Total Posts:  79
Joined:  2008-08-12
 

Ok i funally found the way to get rid of the empty columns.

the width of grind have to be adjusted, so edit this line in styles.css:

.col2-right-layout .products-grid { width:475px; margin:0 auto; }

 Signature 

Running version: 1.4.1.1

 
Magento Community Magento Community
Magento Community
Magento Community
 
RossiTiago
Jr. Member
 
Total Posts:  2
Joined:  2010-07-21
 

thanks very much, you solved my problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pdropi
Jr. Member
 
Total Posts:  5
Joined:  2010-08-18
 

thank u very much oldboy!

for brazilians users:

conforme o oldboy explicou, para arrumar a largura da linha da grade quando são exibidos novos produtos na pánina inicial (home) do magento,
basta editar a largura da coluna no arquivo styles.css para 475px

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
704029 users|1753 users currently online|497345 forum posts