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

Display all products in all categories 1.4.1
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Hi Everyone,

I’m trying to make a “view all” page for my store, and can’t work out how to get all products to show.

So far I’ve built a “new products” page using a CMS static block…

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

and I’ve tried to use..

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

...to show all products. Leaving the category id blank doesn’t work, neither does leaving the whole category part out altogether.

It works for specific categories when I do put an ID in, but how do I list all products from all catergories?

I think this is an issue that only affects 1.4.1 as I’ve found many other people who make this work for their version.

Any help much appreciated!!

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
The Sunday Paper
Sr. Member
 
Total Posts:  202
Joined:  2008-08-06
 

Your root category has a category ID number. What happens when you use that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Thanks for the suggestion but same thing I get ...

“There are no products matching the selection.”

The root category doesn’t technically have any products in it as it has sub-categories and the products are in these.

R

 
Magento Community Magento Community
Magento Community
Magento Community
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Thanks - I did try that. It ws the resourse I was working from but it’s for older versions on Magento so it doesn’t work for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Anyone else managed to crack this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
satish
Enthusiast
 
Avatar
Total Posts:  812
Joined:  2008-03-24
34,mantri Sadan,Shivaji Nagar,Nagpur,MS,India 4400
 

Try this:
Admin->Cms-> Home Page

{{block type=\"catalog/product_list\" name=\"home.catalog.product.list\" alias=\"products_homepage\" template=\"catalog/product/list.phtml\"}}

Satish

 
Magento Community Magento Community
Magento Community
Magento Community
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Thanks - but still no joy.

I’m thinking I may have to just add all new products to the root category and then call that category id.

Seems strange that this feature has been removed from the new version though.

R

 
Magento Community Magento Community
Magento Community
Magento Community
 
satish
Enthusiast
 
Avatar
Total Posts:  812
Joined:  2008-03-24
34,mantri Sadan,Shivaji Nagar,Nagpur,MS,India 4400
 

You should filter your attributes, to display all products.

So you will get all products .

Satish

 
Magento Community Magento Community
Magento Community
Magento Community
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Thanks Satish - but I’m not sure how to do that.

Really appreciate your help!

 
Magento Community Magento Community
Magento Community
Magento Community
 
rwone
Sr. Member
 
Total Posts:  174
Joined:  2009-02-12
 

hi,

i’m having the same issue, my navigation bar has, in the top level:

Home | Category One <- This category contains no products. 

And then then ‘Category One’ contains a sub category which does have products in it. 

When i click on ‘Category One’ it says there are no products. 

When i click on the sub category it does display the products. 

So my question is, how do i get all the product to show when i click on ‘Cateogory One’?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
roghow
Jr. Member
 
Total Posts:  24
Joined:  2010-08-27
 

Think I’ve found a solution for this. I built it on the basis of the special price page in this post: http://www.magentocommerce.com/boards/viewthread/16098/P45/

I\’m not sure if its the best way of doing it but I stripped out the filters from that bit of code so instead of only showing sale items it shows all.

I created a php file All.php and put it in /app/code/local/Mage/Catalog/Block/Product/All.php

<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-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   Mage
 * @package    Mage_Catalog
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */

/**
 * New products block
 *
 * @category   Mage
 * @package    Mage_Catalog
 * @author      Magento Core Team <core@magentocommerce.com>
 */
class Mage_Catalog_Block_Product_All extends Mage_Catalog_Block_Product_Abstract
{
    
protected $_productsCount null;

    const 
DEFAULT_PRODUCTS_COUNT 300;

    protected function 
_beforeToHtml()
    
{
        $todayDate  
Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);
        
        
$collection Mage::getResourceModel(\'catalog/product_collection\');
        
Mage::getSingleton(\'catalog/product_status\')->addVisibleFilterToCollection($collection);
        
Mage::getSingleton(\'catalog/product_visibility\')->addVisibleInCatalogFilterToCollection($collection);
        
        
$collection->getSelect()->order(\'rand()\');
        
$collection $this->_addProductAttributesAndPrices($collection)
          
            ->
addAttributeToSort(\'special_from_date\'\'desc\')
            ->
setPageSize($this->getProductsCount())
            ->
setCurPage(1)
        ;
        
$this->setProductCollection($collection);

        return 
parent::_beforeToHtml();
    
}

    
public function setProductsCount($count)
    
{
        $this
->_productsCount $count;
        return 
$this;
    
}

    
public function getProductsCount()
    
{
        
if (null === $this->_productsCount{
            $this
->_productsCount self::DEFAULT_PRODUCTS_COUNT;
        
}
        
return $this->_productsCount;
    
}
}

Using new.phtml as a base I set up a page called view_all with the content block:

{{block type="catalog/product_all" template="catalog/product/new.phtml"}}

This gives me the first 300 products on my shop in a random order on it\’s own page. Sorted!

Is this a long way around a simple problem? Not sure but it works!

 
Magento Community Magento Community
Magento Community
Magento Community
 
d rock
Jr. Member
 
Total Posts:  10
Joined:  2010-06-30
 

I got this going by editing each product, and for its cateogory, make sure the root category is checked.

Then for your snippet use

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="2" template="catalog/product/list.phtml"}}

Where category_id 2 is your root category, or “Default Category”

Good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
urielmx
Jr. Member
 
Total Posts:  2
Joined:  2010-10-20
 
916Designs - 06 October 2010 02:05 PM

I got this going by editing each product, and for its cateogory, make sure the root category is checked.

Then for your snippet use

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="2" template="catalog/product/list.phtml"}}


Where category_id 2 is your root category, or “Default Category”

Good luck!

Hi! Your layout works great!

Now We have an Issue that apparently doesn’t have solution yet, aroud the same layout: It says how many products there are, but doesnt show pagination :-(

We found a similar issue for magento 1.4.0, but doesn’ works for us: http://www.magentocommerce.com/boards/viewthread/199172/

Do you have the same problem with that layout?

Regards!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top