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 1 of 2
New Products Block Attributes, Changes, and Problems! 
 
RodrigoL
Jr. Member
 
Total Posts:  10
Joined:  2008-08-11
 

Alright, so I got the new products block working on my frontpage....

http://poordonkey.com/shop/

As shown. However, it is only showing 3 of them for some reason not all 6. If you go to Apparel youll see I have 6 designs on there.

I would like for there to be like 4 or 5 images shown per row, on multiple rows.

Another issue at hand is the fact it is displaying the products as “out of stock"… when clearly their not.

Lastly, where can I remove certain elements like the add to wishlist text, and the price from the new products block?

Thanks in advance!

 
Magento Community Magento Community
Magento Community
Magento Community
 
cutemonster
Jr. Member
 
Total Posts:  11
Joined:  2008-07-07
 

I also had out of stock problem before, basically, if you’re not doing configurable but just simple product, just go thru every option and check if it’s enabled and quantity ok. 

visibility=catalog,search
status=enabled
quantity=xxxx
and belongs to one of the categories.

hopes that helps.

Can you please share your view.phtml?  I was looking for tabbed “descriptions and tags” for long time.

ckh827 _at__ hotmail. com
thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
RodrigoL
Jr. Member
 
Total Posts:  10
Joined:  2008-08-11
 

someone please help..

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

I will look into the ‘list.phtml’ file, grid view for clue, and add them to the new.phtml file, then change ‘3’ to ‘4’ or ‘5’.

<?php if ($i++%3==0): ?>

<?php if ($i%3==0 && $i!=$_collectionSize): ?>

<?php for($i;$i%3!=0;$i++): ?>

<?php if ($i%3==0): ?>

Alternatively, I will eliminate the table altogether, and use div with floated elemented - this is more flexible in interms of row display, but it does has problem with equal height, which can be done with min-height, problem is that IE 6 doesn’t support it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RodrigoL
Jr. Member
 
Total Posts:  10
Joined:  2008-08-11
 

Im trying to figure out what your trying to convey here. Can you give a slightly more detailed explanation to the steps I should take to have 4 columns and 4 rows?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

In the list.phtml (product listing page), under the grid view, it has 3 products listing in a row, and the row is controlled by the above php codes. What you can do is study the list.phtml, grid view, and figure out how to place those codes in your ‘new.phtml’.

That is one way of doing it, and a default way by Magento template using table. Whether it’s a better way, is arguable by some but favored by other as it lacks flexibility in terms of row display, but it has advantage for equal height.

Another method is using div, and use float to control the horizontal listing (row), for instance, use ‘ul’ for each listing

<div class="listing_wrap">
<ul>
<li>product image</li>
<li>product description</li>
</ul>

<ul>
<li>product image</li>
<li>product description</li>
</ul>

<ul>
<li>product image</li>
<li>product description</li>
</ul>
</div>

div.listing_wrap {width:660px}
div.listing_wrap ul {width: 150px; float:left; margin-right:10px}

with a 660px width, and 150px for each product, you can have 4 listing in one row with 10px margin right.

This has actually brought up many times concerning products in homepage.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

Also, I just remember there is another way to set columns in a row.

The example is in the catalog > product > list > upsell.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
Leo27
Sr. Member
 
Total Posts:  127
Joined:  2008-10-08
 

hello!

Chinesedream can you please help me doing or solving this.

I also want to change new.phtml to display 4 products per row, maximum 12.
So I need 3 rows, It seems that this problem is stel unsolved. I’m using version 1.1.6 have the same prob.

Can you please tell me how do I implement the div method, since it is probably the best way to do it?

Best regards
L. Nunes

 
Magento Community Magento Community
Magento Community
Magento Community
 
rudack
Jr. Member
 
Total Posts:  10
Joined:  2008-07-09
 

The actual code would be great for us Newbies smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Leo27
Sr. Member
 
Total Posts:  127
Joined:  2008-10-08
 

Yap, that’s true rudack rasberry ...let’s hope someone helps us.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nath247
Jr. Member
 
Total Posts:  3
Joined:  2008-10-28
 

Hi Guys i have allowed for more than three products by changing
this: <?php if($i++%3==0): ?>
to this: <?php if($i++%4==0): ?>

and a few lines below

this:  <?php if($i%3==0 || $i==$_collectionSize): ?>
to this <?php if($i%4==0 || $i==$_collectionSize): ?>

you should be able to do greater than 4. as long as you allow enough room between the widths.

these are located in:
magento\app\design\frontend\default\default\template\catalog\product.

although i am still on a hunt because if you change this you will need to change the css files so the width is less.
sorry if i am unclear first night editing magento code so bear with me and if n e 1 resolves this b 4 me please update.

Please tell me if im even on the right track. i may be totally in the wrong direction.

cheers

 
Magento Community Magento Community
Magento Community
Magento Community
 
Voot
Sr. Member
 
Total Posts:  261
Joined:  2008-03-20
Long Beach, CA
 

Hi- I’m not sure if you guys are still looking for an answer, but I figured it out a few weeks back and forgot the steps I took to complete, so I’ll just give you the entire code for the new.phtml file. In this portion <?php if ($i++%3==0): ?> the 3 controls the number of items shown per row.

<?php if (($_products $this->getProductCollection()) && $_products->getSize()): ?>
<div class="new-products">
<
h3 class="title"><?php echo $this->__('FEATURED PRODUCTS'?></h3>
<
table cellspacing="0" width="695px" class="recently-list" id="recently-compared-list-table">
        
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
        <?php 
if ($i++%3==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(200, 200) ?>" width="200" height="200" alt="<?php echo $this->htmlEscape($_product->getName()) ?>"/>
            </
a>
        </
div>
            <
h5><class="product-name" href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>)"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>
            
<?php echo $this->getReviewsSummaryHtml($_product'short'?>
            <?php 
echo $this->getPriceHtml($_product?>
            <?php 
if($_product->isSaleable()): ?>
            
<a href="#" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><img src="<?php echo $this->getSkinUrl('images/btn_add_to_cart.gif') ?>" alt="Add to Cart"/></a>
            
<?php else: ?>
            
<div class="out-of-stock"><?php echo $this->__('Out of stock'?></div>
            
<?php endif; ?>
            
<div class="clear"></div>
            <
ul class="add-to">
                
<?php if ($this->helper('wishlist')->isAllow()) : ?>
                
<li><a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-cart"><?php echo $this->__('Add to Wishlist'?></a></li>
                
<?php endif; ?>
                <?php 
if($_compareUrl=$this->getAddToCompareUrl($_product)): ?>
                
<li><a href="<?php echo $_compareUrl ?>"><?php echo $this->__('Add to Compare'?></a></li>
                
<?php endif; ?>
            
</ul>
        </
td>
<?php $i++; endforeach; ?>
<?php 
for($i;$i%3!=0;$i++): ?>
        
<td>&nbsp;</td>
    
<?php endfor ?>
    
</tr>
</
table></div>
<?php endif; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
davidgrun
Sr. Member
 
Total Posts:  245
Joined:  2008-07-10
 

Does anyone have the full new.phtml implemented with the grid mode divs??? Can you please shre it here??
I want to change it from the Table structure to the grid divs.
Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
daveloodts
Member
 
Avatar
Total Posts:  67
Joined:  2009-01-05
Belgium
 

davidgrun, do you already found a solution.
I’m very interested in this.

thankx, Dave

 
Magento Community Magento Community
Magento Community
Magento Community
 
davidgrun
Sr. Member
 
Total Posts:  245
Joined:  2008-07-10
 

@DaveLo

No sorry, I didn’t find a sloution and I couldn’t figure it out myself… but the real problem with this is that ‘new’ doesn’t distinguish between websites. So I have two websites that share the same product info with the difference in price. The problem was that ‘new’ displays the product in both websites with the same price. Even worse, if you have the product enabled in Website_1 and disabled in Website_2, the product will show as ‘new’ in Website_2 also… I didn’t see this was going to workout for my setup.

Good luck!
David

 
Magento Community Magento Community
Magento Community
Magento Community
 
fegizii
Sr. Member
 
Total Posts:  160
Joined:  2009-01-21
 
davidgrun - 02 February 2009 03:54 PM

@DaveLo

No sorry, I didn’t find a sloution and I couldn’t figure it out myself… but the real problem with this is that ‘new’ doesn’t distinguish between websites. So I have two websites that share the same product info with the difference in price. The problem was that ‘new’ displays the product in both websites with the same price. Even worse, if you have the product enabled in Website_1 and disabled in Website_2, the product will show as ‘new’ in Website_2 also… I didn’t see this was going to workout for my setup.

Good luck!
David

Did you try to change the “scope” of the products? You migth have to have two sets of the same products with scope=store

good luck

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