It's me again !!!! 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!!!!
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 (21.86 KiB) Viewed 27828 times
Last edited by kreativ on Fri Sep 23, 2011 9:14 pm, edited 1 time in total.
catalog/view/theme/default/template/product/category.tpl
find and delete
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 } ?>
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 (86.9 KiB) Viewed 27664 times
Does this work? i get an error "undefined index thumb".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 } ?>
Εστιατορια Αθηνα http://www.athensmenu.gr
you need to also define 'thumb' in the controller fileThuNderGr wrote:Does this work? i get an error "undefined index thumb".
In catalog/controller/product/category.php
FIND
Code: Select all
$results = $this->model_catalog_category->getCategories($category_id);
foreach ($results as $result) {
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 = '';
}
//
Code: Select all
$this->data['categories'][] = array(
'name' => $result['name'] . ' (' . $product_total . ')',
Code: Select all
'thumb' => $thumb,
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.
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.
Hi All! does anyone knows how to convert refine search into a dropdown <select></select> box... Many thanks in advance.
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.
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 (80.18 KiB) Viewed 24048 times
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
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
Who is online
Users browsing this forum: Bing [Bot] and 72 guests