AbanteCart Community
Shopping Cart Operations => Tips and Tricks => Topic started by: zonavirtuala on April 18, 2014, 01:26:54 PM
-
Category Product Count... similar OpenCart. How?
(Show the number of products inside the subcategories in the storefront header category menu)
View example
-
This is just a matter of adding
<?php echo $category['product_count']?>
in the template for category.
Locate this file: storefront/view/default_html5/template/blocks/category.tpl
Replace:
<a class="productname" href="<?php echo $item['info_url'] ?>"><?php echo $item['name']?></a>
with:
<a class="productname" href="<?php echo $item['info_url'] ?>"><?php echo $item['name']?> (<?php echo $category['product_count']?>)</a>
-
Thanks !
... but in default & template2 ? Who ?
Thank you,
-
... but in default & tamplate2 ? Who ?
This will be similar in other templates. What do you mean by who?
-
not work ...:(
in default... not found code " <a class="productname" href="<?php echo $item['info_url'] ?>"><?php echo $item['name']?></a> " .
storefront/view/default/template/block/category.tpl
in default, code is:
<?php if ( $block_framed ) { ?>
<div class="s_block">
<div class="block_tl">
<div class="block_tr">
<div class="block_tc"><img src="<?php echo $this->templateResource('/image/category.png'); ?>" alt="" /><?php echo $heading_title; ?></div>
</div>
</div>
<div class="block_cl">
<div class="block_cr">
<div class="block_cc">
<?php } ?>
<div class="category_list">
<ul>
<?php
foreach($category_list as $item){
$cname = $item['category_id']==$selected_category_id ? '<b>'.$item['name'].'</b>' : $item['name'];
echo '<li>'.str_repeat(' ',$item['level']).'<a href="'.$item['href'].'">'.$cname.'</a></li>';
}?>
</ul>
</div>
<?php if ( $block_framed ) { ?>
</div>
</div>
</div>
<div class="block_bl">
<div class="block_br">
<div class="block_bc"> </div>
</div>
</div>
</div>
<?php } ?>
-
in template 2, not found ... category.tpl
in template 2 :
extensions/template2/storefront/view/template2/template/blocks/ ... ??