Page 1 of 2

[1.5] old way of display of SUB CATEGORIES

Posted: Thu Jun 09, 2011 11:57 pm
by sivvaa
Hi

We badly need the old way of display of SUB CATEGORIES.

The current one (1.5.x) displays SUBCATEGORIES in a very bad way.

I believe most of the users will agree.

Siva

Re: OpenCart 1.5.0.3 Bug Thread

Posted: Fri Jun 10, 2011 12:21 am
by Daniel
sivvaa wrote:Hi

We badly need the old way of display of SUB CATEGORIES.

The current one (1.5.x) displays SUBCATEGORIES in a very bad way.

I believe most of the users will agree.

Siva

WHICH part of the word bug thread do you not understand. this is not a feature request thread.

are you the the guy who just emailed me about this?

You can not have unlimited number of sub categories showing in the boxes because there is not enough width!.

Re: OpenCart 1.5.0.3 Bug Thread

Posted: Fri Jun 10, 2011 12:28 am
by sivvaa
Hi

I didnt email you. I have just PMed you.

You can check that link to understand what i mean.

Siva

Re: OpenCart 1.5.0.3 Bug Thread

Posted: Fri Jun 10, 2011 12:39 am
by Daniel
sivvaa wrote:Hi

I didnt email you. I have just PMed you.

You can check that link to understand what i mean.

Siva

I got your pm but it is not a feature request forum.

also the categories are set like there set is because if one of the categories does not have an image or a missing image the missing image one looks stupid.


this is a 3 minute job to change if you know php.

Re: OpenCart 1.5.0.3 Bug Thread

Posted: Fri Jun 10, 2011 2:55 am
by scmKORE
How stupid are you people? This is a bug thread, not a "complain about something you don't like about the cart" thread. Stop wasting their time with your problems that aren't bugs.

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Fri Jun 10, 2011 4:45 pm
by sivvaa
Sorry for the trouble.

You can delete this post altogether...

Really sorry for the wrong post...

Re: OpenCart 1.5.0.3 Bug Thread

Posted: Wed Jun 15, 2011 9:29 am
by Melanie
Anyone know how to do this?
Any advice.
Thanks,
Mel

Daniel wrote:
sivvaa wrote:Hi

I didnt email you. I have just PMed you.

You can check that link to understand what i mean.

Siva

I got your pm but it is not a feature request forum.

also the categories are set like there set is because if one of the categories does not have an image or a missing image the missing image one looks stupid.


this is a 3 minute job to change if you know php.

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Fri Jun 17, 2011 11:47 am
by Melanie
Does anybody know how to do this?
Please???????????


Thanks in advance

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Wed Jun 22, 2011 7:42 am
by Melanie
Any one have any ideas?

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Thu Jun 23, 2011 6:50 am
by asphole
Hi Melanie,

Im not sure if this is what you're after but I have edited mine to show category images and not just text links.

To do this:

Edit Catalog>View>Theme>Your_Template>Template>Product>Category.tpl
Find:

Code: Select all

<li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li>

Replace with:

Code: Select all

<li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li> 
<br /> <img src="<?php echo $categories[$i]['thumb']; ?>"  /> <br />
THEN:

Edit Catalog>Controller>Product>Category.php

Find:

Code: Select all

			foreach ($results as $result) {
				$product_total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $result['category_id']));
				
				$this->data['categories'][] = array(
					'name'  => $result['name'] . ' (' . $product_total . ')',
					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
				);
			}
Replace With:

Code: Select all

			foreach ($results as $result) {
				$product_total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $result['category_id']));
				$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
				$this->data['categories'][] = array(
					'name'  => $result['name'] . ' (' . $product_total . ')',
					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
            		'thumb' => $image
				);
			}
Then upload both files to the correct location on your server. Mine just has a <br> tag but you could format this however you like.
Best of luck.

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Thu Jun 23, 2011 7:09 am
by asphole
Sorry, last example had image as static image and not clickable link. Add this instead for a clickable link:

Edit Catalog>View>Theme>Your_Template>Template>Product>Category.tpl
Find:

Code: Select all

Code: Select all

    <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li>

Replace with:

Code: Select all

            <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a> 
      <br /><a href="<?php echo $categories[$i]['href']; ?>" alt="<?php echo $categories[$i]['name']; ?>" title="<?php echo $categories[$i]['name']; ?>"><img src="<?php echo $categories[$i]['thumb']; ?>"  /></a><br /></li>

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Thu Jun 23, 2011 11:02 am
by Melanie
EXCELLENT, making some improvements, but great. Thanks a lot.
Mel

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Sat Jul 02, 2011 5:29 pm
by chirameto
Thanks asphole, Just what I need!

I have been trying to change the category.tpl file before, but it is not working. Now that you have mention the underlying function in category.php, I can get it to work.

Sadly I have to repeat this step once the new version came out.

Just a quick thankyou

Posted: Wed Jul 06, 2011 12:02 am
by PaulD123
Hi,

Just wanted to say thankyou to asphole, was struggling with that one a bit. Your example has suddenly made everything clear.

Paul.

PS I cannot believe how fantastic Open Cart is - the market leader by a long way IMHO. This is my first use/try out and I cannot wait to really get to grips with it. If only my php was a bit stronger :-)

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Wed Jul 06, 2011 12:06 am
by teratyke
Just found this thread, there seems to be two running in parallel.

I have uploaded a VQMOD file for this - should work on a default installation.
See here..
viewtopic.php?f=20&t=34923#p171254
Hope it helps.
Rob

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Mon Jul 11, 2011 9:59 pm
by iamandy
Hey all,

I've done this mod. But it appears that it doesn't change the sub categories of sub categories..

Example:

Image

Image

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Mon Jul 11, 2011 10:06 pm
by teratyke
HI
Did you mean my mod in the other thread?
teratyke wrote:Just found this thread, there seems to be two running in parallel.

I have uploaded a VQMOD file for this - should work on a default installation.
See here..
http://forum.opencart.com/viewtopic.php ... 23#p171254
Hope it helps.
Rob
or the mod further up the page?

Rob

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Mon Jul 11, 2011 10:12 pm
by iamandy
The mod further up, Sorry!

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Mon Jul 11, 2011 11:31 pm
by teratyke
AH ok - don't know about that, sorry.
The vqmod file i posted in the other thread isn't the same code changes as above - so may have a different effect on your site. If you have vqmod installed (I would highly recommend it) then it would be a 2 minute job to see if it works for you. I'm on 1.5.0.5 and it displays sub-sub-cat images.
Rob

Re: [1.5] old way of display of SUB CATEGORIES

Posted: Tue Jul 12, 2011 8:02 am
by iamandy
Okay! When I try your mod, with vqmod.. it just loads my page up as a blank white page. This must be a bug, right?