Page 1 of 2

[solved] Removing "Refine Search" on the category page

Posted: Fri Sep 23, 2011 4:11 pm
by kreativ
It's me again :D !!!! Anywho, I wish to either remove entirely the refine search on the resulting category page or change it from being a text based result into an icon based one.

My layout ATM is on the left side I have the categories module with obviously it's list and amount of items, but when ever I press the category it goes to it's page displaying the txt and a "refine search" list below it....

I don't mind getting my hands dirty changing some code around, it's just that I don't know which one :( thanks for any pointers!!!!

Re: Removing "Refine Search" on the category page

Posted: Fri Sep 23, 2011 8:38 pm
by uksitebuilder
catalog/view/theme/default/template/product/category.tpl

find and delete

Code: Select all

  <?php if ($categories) { ?>
  <h2><?php echo $text_refine; ?></h2>
  <div class="category-list">
    <?php if (count($categories) <= 5) { ?>
    <ul>
      <?php foreach ($categories as $category) { ?>
      <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
      <?php } ?>
    </ul>
    <?php } else { ?>
    <?php for ($i = 0; $i < count($categories);) { ?>
    <ul>
      <?php $j = $i + ceil(count($categories) / 4); ?>
      <?php for (; $i < $j; $i++) { ?>
      <?php if (isset($categories[$i])) { ?>
      <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li>
      <?php } ?>
      <?php } ?>
    </ul>
    <?php } ?>
    <?php } ?>
  </div>
  <?php } ?>


Re: Removing "Refine Search" on the category page

Posted: Fri Sep 23, 2011 9:13 pm
by kreativ
Thanks mate....perfect!!!! thumbs up...you are so cool!!!! it worked a treat I am now a happy man :dance: and now to the pub ;) I'll drink one in your honour LOL

Re: [solved] Removing "Refine Search" on the category page

Posted: Fri Sep 23, 2011 9:21 pm
by uksitebuilder
have 3 - I have hollow legs

Re: [solved] Removing "Refine Search" on the category page

Posted: Fri Sep 23, 2011 9:22 pm
by kreativ
will do!!! LOL

Re: [solved] Removing "Refine Search" on the category page

Posted: Thu Sep 29, 2011 1:14 am
by Eva30
nice one!

Re: [solved] Removing "Refine Search" on the category page

Posted: Mon Oct 24, 2011 12:57 pm
by joy
Need this also. Thank you! :)

Re: [solved] Removing "Refine Search" on the category page

Posted: Mon Oct 24, 2011 9:19 pm
by sinbad
and if you rather show the category icons you can use this also:

Code: Select all

<?php if ($categories) { ?>

  <h2><?php echo $text_refine; ?></h2>

  <div class="category-list">

	 <?php if (count($categories) <= 10) { ?>

    <ul>

      <?php foreach ($categories as $category) { ?>

      <li><a href="<?php echo $category['href']; ?>"> <img src="<?php echo $category['thumb']; ?>" />

      <br />

     <?php echo $category['name']; ?></a></li>

      <?php } ?>

    </ul>

    <?php } else { ?>

     <?php for ($i = 0; $i < count($categories);) { ?>

    <ul>

      <?php $j = $i + ceil(count($categories) / 4); ?>

      <?php for (; $i < $j; $i++) { ?>

      <?php if (isset($categories[$i])) { ?>

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

       <img src="<?php echo $categories[$i]['thumb']; ?>" />

      <br />

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

      <?php } ?>

      <?php } ?>

    </ul>

    <?php } ?>

    <?php } ?>

  </div>

  <?php } ?>

Re: [solved] Removing "Refine Search" on the category page

Posted: Mon Oct 24, 2011 10:47 pm
by joy
sinbad wrote:and if you rather show the category icons you can use this also:...
This looks nice. Thanks for sharing! :)

Re: [solved] Removing "Refine Search" on the category page

Posted: Fri Feb 10, 2012 2:06 am
by ThuNderGr
sinbad wrote:and if you rather show the category icons you can use this also:

Code: Select all

<?php if ($categories) { ?>

  <h2><?php echo $text_refine; ?></h2>

  <div class="category-list">

	 <?php if (count($categories) <= 10) { ?>

    <ul>

      <?php foreach ($categories as $category) { ?>

      <li><a href="<?php echo $category['href']; ?>"> <img src="<?php echo $category['thumb']; ?>" />

      <br />

     <?php echo $category['name']; ?></a></li>

      <?php } ?>

    </ul>

    <?php } else { ?>

     <?php for ($i = 0; $i < count($categories);) { ?>

    <ul>

      <?php $j = $i + ceil(count($categories) / 4); ?>

      <?php for (; $i < $j; $i++) { ?>

      <?php if (isset($categories[$i])) { ?>

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

       <img src="<?php echo $categories[$i]['thumb']; ?>" />

      <br />

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

      <?php } ?>

      <?php } ?>

    </ul>

    <?php } ?>

    <?php } ?>

  </div>

  <?php } ?>
Does this work? i get an error "undefined index thumb".

Re: [solved] Removing "Refine Search" on the category page

Posted: Fri Feb 10, 2012 11:33 pm
by jty
ThuNderGr wrote:Does this work? i get an error "undefined index thumb".
you need to also define 'thumb' in the controller file

In catalog/controller/product/category.php
FIND

Code: Select all

$results = $this->model_catalog_category->getCategories($category_id);

foreach ($results as $result) {
below it ADD

Code: Select all

//
				if ($result['image']) {
					$thumb = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
				} else {
					$thumb = '';
				}
				//
then a little further below, FIND

Code: Select all

$this->data['categories'][] = array(
					'name'  => $result['name'] . ' (' . $product_total . ')',
ADD into that array

Code: Select all

'thumb' => $thumb,
Also, the css needs to be fixed. I'm getting the thumbs listed vertically. And I haven't catered for when a category doesn't have an image

Re: [solved] Removing "Refine Search" on the category page

Posted: Fri Apr 06, 2012 3:01 am
by colours
What should I also remove from the source if I use other language? Thanks in advance!

Re: [solved] Removing "Refine Search" on the category page

Posted: Sat May 05, 2012 6:32 pm
by RNRF
i cant doi this on OC 1.5.2.1

Re: [solved] Removing "Refine Search" on the category page

Posted: Wed Jun 20, 2012 7:58 pm
by HorseMagic
Worked perfect for 1.5.3.1, thank you

Re: [solved] Removing "Refine Search" on the category page

Posted: Mon Oct 15, 2012 12:56 am
by jdoe
Tried this on 1.5.4.1 and whilst it happily removed the refine search, it also made every sub-category page layout exactly the same, so no matter what sub i was selecting, i still got the full range of products.

Did i delete too much?

The refine search list is really ugly, and unnecassary if you have a category module on the same page - here's hoping it becomes an easily diabled module in the next update.

Re: [solved] Removing "Refine Search" on the category page

Posted: Thu Oct 25, 2012 10:00 am
by d3us
works fine on 1.5.4 :)

Re: [solved] Removing "Refine Search" on the category page

Posted: Sat Dec 01, 2012 3:13 pm
by ryancalderon
Hi All! does anyone knows how to convert refine search into a dropdown <select></select> box... Many thanks in advance.

Re: [solved] Removing "Refine Search" on the category page

Posted: Tue Jan 29, 2013 5:21 pm
by mikejones85
Hi all!

I'm running Opencart 1.5.1.3 - I've followed the instructions above in order to remove the refine search however all I found was that it removed all the text within the refine search (i.e. I was left with the title etc.).

I created a separate post with a screenshot (http://forum.opencart.com/viewtopic.php?f=20&t=94004) and have also attached it here.

Can anyone point me in the right direction of how to completely remove this?

P.S. Re the drop down menu question - I think I've seen an extension for this - take a look in the extensions directory.

Re: [solved] Removing "Refine Search" on the category page

Posted: Thu Mar 14, 2013 7:24 am
by aansari
Hi
I use OC Version 1.5.5.1 and get error message below;

Notice: Undefined variable: result in /homepages/24/d439278145/htdocs/catalog/controller/product/category.php on line 177Notice: Undefined variable: results in /homepages/24/d439278145/htdocs/catalog/controller/product/category.php on line 184Warning: Invalid argument supplied for foreach() in /homepages/24/d439278145/htdocs/catalog/controller/product/category.php on line 184

When I add 'thumb' => $thumb, into array.
I need help where to add this 'thumb' => $thumb, in

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


Thanks

Re: [solved] Removing "Refine Search" on the category page

Posted: Tue May 07, 2013 2:36 pm
by FCWC
aansari - I don't have a direct answer but I do believe there is a VQMod that will do this for you now.