like this site has,
http://www.shrimantech.com/opencart/dem ... ommon/home
i would like to know what code is needed to show the number of products in that category.
example
Desktops (20)
- Mac (12)
- PC (8)
many thanks

Danny
Code: Select all
if ($this->category_id == $result['category_id']) {
$output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path)) . '"><b>' . $result['name'] . '</b></a>';
} else {
$output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path)) . '">' . $result['name'] . '</a>';
}
Code: Select all
$this->load->model('catalog/product');
$getTotal = '('. $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']) .')';
if ($this->category_id == $result['category_id']) {
$output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path)) . '"><b>' . $result['name'] . '</b></a>'. $getTotal;
} else {
$output .= '<a href="' . $this->model_tool_seo_url->rewrite($this->url->http('product/category&path=' . $new_path)) . '">' . $result['name'] . '</a>' . $getTotal;
}
http://www.alreadymade.com
Follow me on twitter.com/alreadymade
The most terrifying words in the English language are: I'm from the government and I'm here to help.
Ronald Reagan
Digital Chaos | Graphic Design Studio http://www.digitalchaos.biz
Digital Chaos Prints | Custom Art Prints http://www.digitalchaosprints.biz
That's right. The "Components" category doesn't have any products, so it doesn't count any.leprimo wrote:V.1.3.4, oh,what have I done?
Components (0) but subcategory Monitors(3)
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Code: Select all
$this->load->model('catalog/product');
$getTotal = '('. $this->model_catalog_product->getTotalProductsByCategoryId($result['category_id']) .')';
if ($this->category_id == $result['category_id']) {
$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path) . '"><b>' . $result['name'] . '</b></a>'. $getTotal;
} else {
$output .= '<a href="' . $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/category&path=' . $new_path) . '">' . $result['name'] . '</a>' . $getTotal;
}
I have added a message at the top of the category list to let customers know there may be items in sub-categories of empty top level categories.leprimo wrote:Mmhh, but only silly users click on categories without entry.![]()
I think that's not really good.
Code: Select all
<div id="category" class="middle"><?php echo 'Empty categories may have items in subcategories';?></br></br><?php echo $category; ?></div>
http://www.hostedmalls.com
http://www.hostedmalls.com/demo/store/
http://www.getimacroscripts.com
http://www.myyearbookscripts.com
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
As explained earlier in this thread, it is not possible.Maansy wrote:I want to show something like that:
Category_A (14)
Subcategory_A (3)
Subcategory_B (5)
Subcategory_C (6)
How do I do that?
thanks
http://www.hostedmalls.com
http://www.hostedmalls.com/demo/store/
NOTHING is not possiblePerthaussie wrote:As explained earlier in this thread, it is not possible.Maansy wrote:I want to show something like that:
Category_A (14)
Subcategory_A (3)
Subcategory_B (5)
Subcategory_C (6)
How do I do that?
thanks
ALL Templates :: 1.5.1+ Templates :: 50%-75% PRICE DROP ONLY at OpencartStuff.com
Users browsing this forum: Majestic-12 [Bot] and 77 guests