Post by jepmaster » Wed Mar 27, 2013 9:14 am

Hi all. So in an older version of Opencart I was able to customize my top navigation to display the sub-category thumbnails and the description. I've upgraded to the latest version and it's no longer working.

It's only returning:
[name] and [href]

How will I go about getting the thumbnail [image] link and [description] data?

Any help would be greatly appreciated!

Newbie

Posts

Joined
Thu Sep 08, 2011 9:27 am

Post by jepmaster » Wed Mar 27, 2013 10:15 am

Nevermind. I found the solution.

For anyone wanting to put subcategory thumbnails in their top dropdown menu:

Modify:
catalog/controller/common/header.php

Change:

Code: Select all

$children_data[] = array(
						'name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
						'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']),
						
					);	
To:

Code: Select all

$children_data[] = array(
						'name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
						'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']),
						'image' => $child['image'],
						'description' => $child['description']
					);	
Save, then modify:
catalog/view/theme/default/template/common/header.tpl

and under the if(isset($category['children'][$i])), (under <div id="menu">) you can call the image as such:

Code: Select all

<img src="image/<?php echo $category['children'][$i]['image']; ?>" width="" />

Newbie

Posts

Joined
Thu Sep 08, 2011 9:27 am

Post by Flysan » Mon Aug 31, 2015 9:57 pm

How to make it work on OC 2.0.2.0?

New member

Posts

Joined
Tue Apr 28, 2015 6:25 pm

Post by IP_CAM » Tue Sep 01, 2015 6:59 am

Good Idea!
For my OC V.1.5.6.5_rc, I had to use one of the existing default Lines in order to have Product Counting working.
Info and images here:
http://ipc.li/os/subcat_menu_image156.zip
Thank you!
Ernie
PS. Only works NICE with rather FEW Subcategories! :D
http://www.hitline.info/shop/
Last edited by IP_CAM on Tue Sep 01, 2015 10:11 am, edited 2 times in total.

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by IP_CAM » Tue Sep 01, 2015 7:45 am

Flysan wrote:How to make it work on OC 2.0.2.0?
at best, by trail and error! See my file, in the ZIP, linked above, to compare the content with your v.2.x files, for similarities, and differences.
Good Luck
Ernie
PS: You'll possibly find something here as well:
http://www.opencart.com/index.php?route ... y%20Images

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 23 guests