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

Page 2 of 2
How do I change # items/row in new.phtml? 
 
Cole Geissinger
Sr. Member
 
Avatar
Total Posts:  174
Joined:  2008-12-23
Northern California
 

Using the code provided above just give’s me a blank page :( My header is still there but nothing below…

Any other suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
anjordan77
Sr. Member
 
Total Posts:  79
Joined:  2009-11-18
 

In Admin CMS > Pages

Click on Home Page

Design on the left
Layout update XML put the following:

<reference name="content">
  <
block type="catalog/product_new" name="home.product.new" alias="product_new" template="catalog/product/new.phtml">
    <
action method="setProductsCount"><count>4</count></action>
    <
action method="addPriceBlockType">
      <
type>bundle</type>
      <
block>bundle/catalog_product_price</block>
      <
template>bundle/catalog/product/price.phtml</template>
    </
action>
  </
block>
</
reference>

I haven’t figured out how to put more than the 4 products out there even changing that productscount to 5 or 15 etc does nothing to mine...i tried all the methods in this thread but still no luck.  This gets the new products on the home page though for those looking for that...not sure how to get it edited down to randomly rotate them or to put more than 4 up

 
Magento Community Magento Community
Magento Community
Magento Community
 
hawks1
Member
 
Total Posts:  49
Joined:  2009-07-06
 
rickygri - 22 March 2009 06:38 AM

I went to: app/code/core/Mage/Catalog/Block/Product/New.php and changed:

const DEFAULT_PRODUCTS_COUNT 5;

to:

const DEFAULT_PRODUCTS_COUNT 10;

and updated parameters in the new.phtml file to 10:

<?php if (($_products $this->getProductCollection()) && $_products->getSize()): ?>
<div class="blockinfobox">
<
div class="box recently">
<
table cellspacing="0" class="recently-list" id="recently-compared-list-table">
<
tr>
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
    <?php 
if ($i++&#x10;==0): ?>
    
<tr>
    
<?php endif ?>
        
<td>
        <
div>
            <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
                <
img class="product-image" src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(80, 77) ?>" width="80" height="77" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
            </
a>
        </
div>
            <
p><class="product-name" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>)"><?php echo $this->htmlEscape($_product->getName()) ?></a></p>
            
<?php echo $this->getReviewsSummaryHtml($_product'short'?>
            <?php 
echo $this->getPriceHtml($_product?>
            <?php 
if($_product->isSaleable()): ?>
            
<button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart'?></span></button>
            
<?php else: ?>
            
<div class="out-of-stock"><?php echo $this->__('Out of stock'?></div>
            
<?php endif; ?>
            
<div class="clear"></div>
            <
class="add-to">
                
<?php if ($this->helper('wishlist')->isAllow()) : ?>
                
<a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-cart"><?php echo $this->__('Add to Wishlist'?></a>
                
<?php endif; ?>
                <?php 
if($_compareUrl=$this->getAddToCompareUrl($_product)): ?><br/>
                <
a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare'?></a>
                
<?php endif; ?>
            
</p>
        </
td>
<?php $i++; endforeach; ?>
<?php 
for($i;$i&#x10;!=0;$i++): ?>
        
<td>&nbsp;</td>
    
<?php endfor ?>
    
</tr>
</
table>
</
div>
</
div>
<?php endif; ?>

Then added a div in boxes.css:

.blockinfobox { height:440pxwidth:690pxmargin-top:16pxborder:1px solid #5c7989; padding-left:50px; padding-top:10px; float:left; display:inline; }

The new.phtml file is now contained in a div which floats left, and the new.php and new.phtml files are both set to limits of 10. This seemed to allow for 10 new products, which automatically fill the div to 2 rows of 5. The css is just a border to show where its being contained. Also, this div will fit in the main column of the ‘2 column-left layout’, but will not display correctly in a 3 column, just change the div width/height to fit your template.

Hope this helps someone!

THANKS YOUR POST , I use your method to display 8 product from 5 .

 
Magento Community Magento Community
Magento Community
Magento Community
 
hawks1
Member
 
Total Posts:  49
Joined:  2009-07-06
 
anjordan77 - 03 December 2009 11:09 AM

In Admin CMS > Pages

Click on Home Page

Design on the left
Layout update XML put the following:

<reference name="content">
  <
block type="catalog/product_new" name="home.product.new" alias="product_new" template="catalog/product/new.phtml">
    <
action method="setProductsCount"><count>4</count></action>
    <
action method="addPriceBlockType">
      <
type>bundle</type>
      <
block>bundle/catalog_product_price</block>
      <
template>bundle/catalog/product/price.phtml</template>
    </
action>
  </
block>
</
reference>

I haven’t figured out how to put more than the 4 products out there even changing that productscount to 5 or 15 etc does nothing to mine...i tried all the methods in this thread but still no luck.  This gets the new products on the home page though for those looking for that...not sure how to get it edited down to randomly rotate them or to put more than 4 up

THIS ONE IS WORK FOR ME TOO.... THANKS YOU !! no need to change core files

 
Magento Community Magento Community
Magento Community
Magento Community
 
hawks1
Member
 
Total Posts:  49
Joined:  2009-07-06
 
hawks1 - 29 April 2010 03:07 AM

anjordan77 - 03 December 2009 11:09 AM
In Admin CMS > Pages

Click on Home Page

Design on the left
Layout update XML put the following:
<reference name="content">
  <
block type="catalog/product_new" name="home.product.new" alias="product_new" template="catalog/product/new.phtml">
    <
action method="setProductsCount"><count>4</count></action>
    <
action method="addPriceBlockType">
      <
type>bundle</type>
      <
block>bundle/catalog_product_price</block>
      <
template>bundle/catalog/product/price.phtml</template>
    </
action>
  </
block>
</
reference>

I haven’t figured out how to put more than the 4 products out there even changing that productscount to 5 or 15 etc does nothing to mine...i tried all the methods in this thread but still no luck.  This gets the new products on the home page though for those looking for that...not sure how to get it edited down to randomly rotate them or to put more than 4 up

THIS ONE IS WORK FOR ME TOO.... THANKS YOU !! no need to change core files

I plan to use this method , and don’t want to change core file too .
But i can manage to change one row for 5 , 8 , 10
but i can not make it as 2 row or 3 row for 10, 16 , 20 / 15, 24, 30 ,,,See ?
((( When over the difine quantity , the add-on product does not show for next row , it is still in 1st row’s right side , which cause the designed width become wider ))
In order to display correctly , i have to wrote “ 3 “ in <reference> at present . So totally New block just show one row .
Can anyone help ? Thank you .

 
Magento Community Magento Community
Magento Community
Magento Community
 
spamm
Jr. Member
 
Total Posts:  5
Joined:  2009-09-24
Antwerp
 
hawks1 - 01 June 2010 08:11 PM

hawks1 - 29 April 2010 03:07 AM
anjordan77 - 03 December 2009 11:09 AM
In Admin CMS > Pages

Click on Home Page

Design on the left
Layout update XML put the following:
<reference name="content">
  <
block type="catalog/product_new" name="home.product.new" alias="product_new" template="catalog/product/new.phtml">
    <
action method="setProductsCount"><count>4</count></action>
    <
action method="addPriceBlockType">
      <
type>bundle</type>
      <
block>bundle/catalog_product_price</block>
      <
template>bundle/catalog/product/price.phtml</template>
    </
action>
  </
block>
</
reference>

I haven’t figured out how to put more than the 4 products out there even changing that productscount to 5 or 15 etc does nothing to mine...i tried all the methods in this thread but still no luck.  This gets the new products on the home page though for those looking for that...not sure how to get it edited down to randomly rotate them or to put more than 4 up

THIS ONE IS WORK FOR ME TOO.... THANKS YOU !! no need to change core files

I plan to use this method , and don’t want to change core file too .
But i can manage to change one row for 5 , 8 , 10
but i can not make it as 2 row or 3 row for 10, 16 , 20 / 15, 24, 30 ,,,See ?
((( When over the difine quantity , the add-on product does not show for next row , it is still in 1st row’s right side , which cause the designed width become wider ))
In order to display correctly , i have to wrote “ 3 “ in <reference> at present . So totally New block just show one row .
Can anyone help ? Thank you .

Add one of the following actions (depending on your layout) to change the number of columns displayed:

<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>

You might also want to adjust the width in styles.css, look for:

.col2-left-layout .products-grid,
.
col2-right-layout .products-grid { width:684pxmargin:0 auto}
.col1-layout .products-grid,
.
page-empty .products-grid { width:941pxmargin:0 auto}

Clear your cache to view the changes

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2