Here is my Tutorial (Tested with PrestaShop v. 1.5.2.0 AND 1.5.4.1):
open this file: controllers/front/CategoryController.php
search this lines:
if ($subCategories = $this->category->getSubCategories($this->context->language->id))
{
insert this code after the: {
$subcategory_objects=array();
$this->context->smarty->assign("andr_lang",intval($cookie->id_lang));
foreach ($subCategories as $subcategory)
{
$sub=new Category(intval($subcategory['id_category']),intval($cookie->id_lang));
$subcategory_objects[$subcategory['id_category']]=$sub;
}
//var_dump($subcategory_objects);
$this->context->smarty->assign("subcategories_objects",$subcategory_objects);
save this file and upload.
now open the file: themes/"your_theme"/category.tpl
search this lines:
<div class="content_sortPagiBar">
{include file="$tpl_dir./pagination.tpl"}
<div class="sortPagiBar clearfix">
{include file="./product-sort.tpl"}
{include file="./product-compare.tpl"}
{include file="./nbr-product-page.tpl"}
</div>
</div>
insert after the </div></div>:
{if isset($subcategories)}
{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-sub.tpl" products=$subcategory_object->getProducts('1','1','100')}
{/foreach}
{else}
{include file="./product-list.tpl" products=$products}
{/if}
save and upload.
now open this file: themes/"your_theme"/product-list.tpl
search this line:
<!-- Products list -->
after the line insert this:
<h4>{$subcategory.name|escape:'htmlall':'UTF-8'}</h4>
search this line:
{foreach from=$products item=product name=products}
after this line add:
{if $products != ''}
now search this lines:
<a class="button lnk_view" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View'}">{l s='View'}</a>
</div>
</li>
after this lines add:
{else}
No Products in this Category
{/if}
save the product-list.tpl as product-list-sub.tpl and upload the files.
DONE!!!
I hope it will works... contact me if you have problems....
sorry for my bad english
best regards