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

New products display wrong
 
alehano
Jr. Member
 
Total Posts:  18
Joined:  2008-10-24
 

When I insert this to CMS page:

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}}

It display all products include hidden (simple products in configurable product set). It ignore “set new from date” attribute.

Bug only on 1.3 version

 
Magento Community Magento Community
Magento Community
Magento Community
 
Freddy Bang
Member
 
Total Posts:  52
Joined:  2009-02-04
 

It also happens for me using Magento v1.3.0 anyone has a solution for this?

Even in the cart I see simple products in the ‘Based on your cart, you might be interesting in these products’ box.

I really don’t get it my simple products are ALL marked as invisible so why are they shown ? Is this a ‘bug’ in the new 1.3.0 release and what can be done to make the invisible again?

Any help is much appriciated since my simple products don’t have images so it really doesn’t loook nice…

Worth to mention is that in the normal listings the invisible products are not displayed it’s only in the new products, most viewed and the special cart box..

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
pouya
Jr. Member
 
Total Posts:  16
Joined:  2008-05-12
 

I have the same Problem!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Freddy Bang
Member
 
Total Posts:  52
Joined:  2009-02-04
 

Just for information..

I don’t have any problem when using this tip http://www.magentocommerce.com/wiki/how-to/featured_products_from_a_category_on_frontpage to present our featured products on our homepage.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pableu
Jr. Member
 
Total Posts:  29
Joined:  2008-09-19
 

I have exactly the same problem in our installation. Any inputs on how to resolve this would be appreciated smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-12-16
 

arrghh after all this effort I get stumped by the new products messing around

anyone resolved this yet?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dx3webs
Sr. Member
 
Avatar
Total Posts:  178
Joined:  2008-12-16
 

I gave up in the end and made a featured products replacement following the instructions in the wiki

works just as well and if anything makes more sence than the from > to method for new products

 
Magento Community Magento Community
Magento Community
Magento Community
 
Freddy Bang
Member
 
Total Posts:  52
Joined:  2009-02-04
 

I’m not sure if you’re using this block type to present the products from the category?

{{block type="catalog/product_list" category_id="2" template="catalog/product/featured.phtml"}}

I never got the number and random attributes to work so I implemented the logic using shuffle() function and a simple if i==8 break; directly in the featured.phtml. If you like you can see it in action on http://www.laerkeoglillebror.dk on the homepage.

Code sniffert:

Add shuffle() to get random products from the category:

<?php if(!$_productCollection->count()): ?>
<div class="note-msg">
<?php echo $this->__('There are no products matching the selection.') ?>
</div>
<?php else: ?>

<?php
$_items = $_productCollection->getItems();
shuffle($_items);
?>

.....

use the suffled items in the foreach
<?php $i=0; foreach ($_items as $_product): ?>

Before the endforeach add a break when the number of items to display is met, in my case I show 8 on homepage and 6 in our weekly newsletter…

<?php if ($i==8) break; ?>
<?php endforeach ?>
<script type="text/javascript">decorateGeneric($$(’.grid-row’), [’last’, ‘odd’, ‘even’]);</script>

 
Magento Community Magento Community
Magento Community
Magento Community
 
Loic_LC
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2007-12-19
Paris, France
 

Freddy Bang’s solution also worked for me.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
fegizii
Sr. Member
 
Total Posts:  160
Joined:  2009-01-21
 
Freddy Bang - 15 April 2009 01:02 AM

I’m not sure if you’re using this block type to present the products from the category?

{{block type="catalog/product_list" category_id="2" template="catalog/product/featured.phtml"}}

I never got the number and random attributes to work so I implemented the logic using shuffle() function and a simple if i==8 break; directly in the featured.phtml. If you like you can see it in action on http://www.laerkeoglillebror.dk on the homepage.

Code sniffert:

Add shuffle() to get random products from the category:

<?php if(!$_productCollection->count()): ?>
<div class="note-msg">
<?php echo $this->__('There are no products matching the selection.') ?>
</div>
<?php else: ?>

<?php
$_items = $_productCollection->getItems();
shuffle($_items);
?>

.....

use the suffled items in the foreach
<?php $i=0; foreach ($_items as $_product): ?>


Before the endforeach add a break when the number of items to display is met, in my case I show 8 on homepage and 6 in our weekly newsletter…

<?php if ($i==8) break; ?>
<?php endforeach ?>
<script type="text/javascript">decorateGeneric($$(’.grid-row’), [’last’, ‘odd’, ‘even’]);</script>

Could you please post the entire code? I have tried to make those changes but i get a blank page and i dunno how to debug php.

This is what i have. Could you post your code so i can compare what i’ve done wrong?

<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>

<?php 
if(!$_productCollection->count()): ?>
<div class="note-msg">
<?php echo $this->__('There are no products matching the selection.'?>
</div>
<?php else: ?>

<?php
$_items 
$_productCollection->getItems();
shuffle($_items);
?> 

<div class="head-alt">    
   <
img src="<?php echo $this->getSkinUrl('images/spe_prod.jpg') ?>" alt="<?php echo $this->__('Featured Products') ?>" title="<?php echo $this->__('Featured Products') ?>" />
</
div>

<?php // Grid Mode ?>
<div class="listing-type-grid  catalog-listing padder"> <!-- the class name will change to .listing-type-cell if viewing in list mode -->
<?php $_collectionSize $_productCollection->count() ?>
    
<table cellspacing="0" class="generic-product-grid" id="product-list-table">
    
<?php $i=0; foreach ($_items as $_product): ?>
    <?php 
if ($i++%4==0): ?>
    
<tr>
    
<?php endif ?>
        
<td>            
            <
class="product-image">
                <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>">
                    <
img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(170, 170); ?>" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
                </
a>
            </
p>
            <
h5><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>             
            
<?php if($_product->getRatingSummary()): ?>
            <?php 
echo $this->getReviewsSummaryHtml($_product'short'?>
            <?php 
endif; ?>
            <?php 
echo $this->getPriceHtml($_producttrue?>
            <?php 
if($_product->isSaleable()): ?>
            
<a href="<?php echo $_product->getProductUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/btn_more_info.gif') ?>" alt="More Info"/></a>
            
<?php else: ?>
            
<div class="out-of-stock"><?php echo $this->__('Out of stock'?></div>
            
<?php endif; ?>
            
<div class="clear"></div>            
        </
td>
    
<?php if ($i%4==&& $i!=$_collectionSize): ?>
    
</tr>
    
<?php if ($i==4) break; ?>
    <?php 
endforeach ?> 
    <?php 
for($i;$i%4!=0;$i++): ?>
          
<td class="empty-product">&nbsp;</td>
    
<?php endfor ?>
    <?php 
if ($i%4==0): ?>
    
</tr>
    
<?php endif ?>
    
</table>
    <
script type="text/javascript">decorateTable('product-list-table')</script>
</div>

<?php endif; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Freddy Bang
Member
 
Total Posts:  52
Joined:  2009-02-04
 

Below you see the code creating 2 rows with 4 products in each all shuffled from a category specified in the block tag, see below:

<h3><a href="{{store direct_url="pige"}}">Udvalgte produkter til piger (klik for at se alle)</a></h3>
{{block type="catalog/product_list" category_id="41" template="catalog/product/featured8.phtml"}}

I use 3 .phtml pages 4, 8, 12 products and you can see a it live here www.laerkeoglillebror.dk.

-------------------

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>
<?php $_productCollection
=$this->getLoadedProductCollection() ?>
<?php 
if(!$_productCollection->count()): ?>
<div class="note-msg">
    
<?php echo $this->__('There are no products matching the selection.'?>
</div>
<?php else: ?>

<?php
  $_items 
$_productCollection->getItems();
  
shuffle($_items);
?>

<?php 
// Grid Mode ?>
<div class="listing-type-grid catalog-listing">
<?php $_collectionSize $_productCollection->count() ?>
    <?php $i
=0; foreach ($_items as $_product): ?>
        <?php 
if($i++%4==0): ?>
        
<ol class="grid-row">
        
<?php endif; ?>
            
<li class="item">
                <
class="product-image">
                    <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>">
                        <
img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" title="<?php echo $this->htmlEscape($this->getImageLabel($_product, 'small_image')) ?>" />
                    </
a>
                </
p>
                <
h5><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></h5>
                
<?php if($_product->getRatingSummary()): ?>
                <?php 
//echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                
<?php endif; ?>
                <?php 
echo $this->getPriceHtml($_producttrue?>
                <?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; ?>
            
</li>
        
<?php if($i%4==|| $i==$_collectionSize): ?>
        
</ol>
        
<?php endif; ?>

        <?php 
if ($i==8) break; ?>
    <?php 
endforeach ?>
    
<script type="text/javascript">decorateGeneric($$('.grid-row'), ['last''odd''even']);</script>
</div>
<?php endif; ?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top