Post by kreativ » Fri Sep 23, 2011 4:11 pm

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!!!!

Attachments

search1.jpg

search1.jpg (21.86 KiB) Viewed 24832 times

Last edited by kreativ on Fri Sep 23, 2011 9:14 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri Sep 02, 2011 4:55 am

Post by uksitebuilder » Fri Sep 23, 2011 8:38 pm

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 } ?>


ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by kreativ » Fri Sep 23, 2011 9:13 pm

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

Newbie

Posts

Joined
Fri Sep 02, 2011 4:55 am

Post by uksitebuilder » Fri Sep 23, 2011 9:21 pm

have 3 - I have hollow legs

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by kreativ » Fri Sep 23, 2011 9:22 pm

will do!!! LOL

Newbie

Posts

Joined
Fri Sep 02, 2011 4:55 am

Post by Eva30 » Thu Sep 29, 2011 1:14 am

nice one!

User avatar
New member

Posts

Joined
Fri Sep 09, 2011 4:17 pm

Post by joy » Mon Oct 24, 2011 12:57 pm

Need this also. Thank you! :)

OC version 1.5.1.3


joy
New member

Posts

Joined
Fri Oct 14, 2011 9:18 am

Post by sinbad » Mon Oct 24, 2011 9:19 pm

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 } ?>

Attachments

snap1.png

snap1.png (86.9 KiB) Viewed 24668 times


User avatar
New member

Posts

Joined
Sun Oct 23, 2011 12:52 pm

Post by joy » Mon Oct 24, 2011 10:47 pm

sinbad wrote:and if you rather show the category icons you can use this also:...
This looks nice. Thanks for sharing! :)

OC version 1.5.1.3


joy
New member

Posts

Joined
Fri Oct 14, 2011 9:18 am

Post by ThuNderGr » Fri Feb 10, 2012 2:06 am

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".

Εστιατορια Αθηνα http://www.athensmenu.gr


Newbie

Posts

Joined
Fri Feb 03, 2012 5:08 pm

Post by jty » Fri Feb 10, 2012 11:33 pm

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

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by colours » Fri Apr 06, 2012 3:01 am

What should I also remove from the source if I use other language? Thanks in advance!

Newbie

Posts

Joined
Sun Feb 19, 2012 9:10 pm

Post by RNRF » Sat May 05, 2012 6:32 pm

i cant doi this on OC 1.5.2.1

Newbie

Posts

Joined
Mon Apr 16, 2012 12:34 am

Post by HorseMagic » Wed Jun 20, 2012 7:58 pm

Worked perfect for 1.5.3.1, thank you

Anita


User avatar
New member

Posts

Joined
Sat Jan 21, 2012 1:55 pm
Location - Australia

Post by jdoe » Mon Oct 15, 2012 12:56 am

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.

Newbie

Posts

Joined
Sat Oct 13, 2012 9:25 pm

Post by d3us » Thu Oct 25, 2012 10:00 am

works fine on 1.5.4 :)

Newbie

Posts

Joined
Thu Oct 25, 2012 9:58 am

Post by ryancalderon » Sat Dec 01, 2012 3:13 pm

Hi All! does anyone knows how to convert refine search into a dropdown <select></select> box... Many thanks in advance.

Newbie

Posts

Joined
Wed Oct 24, 2012 9:08 am

Post by mikejones85 » Tue Jan 29, 2013 5:21 pm

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.

Attachments

Screenshot.jpg

Screenshot.jpg (80.18 KiB) Viewed 21052 times


Newbie

Posts

Joined
Mon Jan 28, 2013 7:59 pm

Post by aansari » Thu Mar 14, 2013 7:24 am

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

New member

Posts

Joined
Wed May 26, 2010 7:20 am

Post by FCWC » Tue May 07, 2013 2:36 pm

aansari - I don't have a direct answer but I do believe there is a VQMod that will do this for you now.

New member

Posts

Joined
Tue Jul 31, 2012 3:17 am
Who is online

Users browsing this forum: No registered users and 15 guests