Based on this post: http://www.prestashop.com/forums/topic/61907-displaying-all-products-from-subcategories-on-the-category-page/page-3?do=findComment&comment=1278016
(Use at your own risk, this is working on my 1.6 store, but I am by no means a Prestashop expert.)
Create the following file: override/controllers/front/CategoryController.php
With this code:
<?php
class CategoryController extends CategoryControllerCore
{
public $php_self = 'category';
protected $category;
public $customer_access = true;
public $subCatProdCount = 0;
/**
* Assign sub categories templates vars
*/
protected function assignSubcategories()
{
if ($subCategories = $this->category->getSubCategories($this->context->language->id))
{
$subcategory_objects=array();
foreach ($subCategories as $subcategory)
{
$sub=new Category(intval($subcategory['id_category']));//,intval($cookie->id_lang));
$subcategory_objects[$subcategory['id_category']]=$sub;
$this->subCatProdCount += $sub->getProducts(null, null, null, $this->orderBy, $this->orderWay, true);
}
$this->context->smarty->assign("subcategories_objects",$subcategory_objects);
$this->context->smarty->assign(array(
'subcategories' => $subCategories,
'subcategories_nb_total' => count($subCategories),
'subcategories_nb_half' => ceil(count($subCategories) / 2)
));
}
}
public function assignProductList()
{
$hookExecuted = false;
Hook::exec('actionProductListOverride', array(
'nbProducts' => &$this->nbProducts,
'catProducts' => &$this->cat_products,
'hookExecuted' => &$hookExecuted,
));
// The hook was not executed, standard working
if (!$hookExecuted)
{
$this->context->smarty->assign('categoryNameComplement', '');
$this->nbProducts = $this->category->getProducts(null, null, null, $this->orderBy, $this->orderWay, true);
$this->pagination((int)$this->nbProducts); // Pagination must be call after "getProducts"
$this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay);
}
// Hook executed, use the override
else
// Pagination must be call after "getProducts"
$this->pagination($this->nbProducts);
Hook::exec('actionProductListModifier', array(
'nb_products' => &$this->nbProducts,
'cat_products' => &$this->cat_products,
));
foreach ($this->cat_products as &$product)
if ($product['id_product_attribute'] && isset($product['product_attribute_minimal_quantity']))
$product['minimal_quantity'] = $product['product_attribute_minimal_quantity'];
$this->addColorsToProductList($this->cat_products);
$this->nbProducts += $this->subCatProdCount;
$this->context->smarty->assign('nb_products', $this->nbProducts);
}
}
In the bootstrap theme, category.tpl find the following code:
{if $products}
<div class="content_sortPagiBar clearfix">
<div class="sortPagiBar clearfix">
{include file="./product-sort.tpl"}
{include file="./nbr-product-page.tpl"}
</div>
<div class="top-pagination-content clearfix">
{include file="./product-compare.tpl"}
{include file="$tpl_dir./pagination.tpl"}
</div>
</div>
{include file="./product-list.tpl" products=$products}
<div class="content_sortPagiBar">
<div class="bottom-pagination-content clearfix">
{include file="./product-compare.tpl" paginationId='bottom'}
{include file="./pagination.tpl" paginationId='bottom'}
</div>
</div>
{/if}
And replace the {/if} with:
{elseif isset($subcategories_objects)}
{foreach from=$subcategories item=subcategory}
{assign var="subcategory_id" value=$subcategory.id_category}
{assign var="subcategory_object" value=$subcategories_objects.$subcategory_id}
{include file="./product-list.tpl" products=$subcategory_object->getProducts('1','1','100','price','desc')}
{/foreach}
{/if}
It's not perfect (as in you can't sort, compare, etc.) but at least you can view products in subcategories.