News:

Looking for documentation? Take a look on our wiki

Main Menu

Search results without category list

Started by IB Development Team, April 25, 2012, 20:11:12 PM

Previous topic - Next topic

IB Development Team

Hello,

VM2 search results screen contains category list before search results if showCategory is enabled in config.

Attached please find patch for VM2 2.0.6a that hides category list on search results page - only search results are displayed.

Please consider including into mainstream.

Regards,
Pawel

IB Development Team
http://dev.ib.pl/


[attachment cleanup by admin]

armin17

Please, if you can make a pach for a similar problem:
When I click on link "show All products form manufacturer" on Manufacturer Details Layout page:

VM2 All products from manufacturer  screen contains category list before products from manufacturer. (  if showCategory is enabled in config).

Can I hide a category on this page. On the other pages except the search page, I need to display categories.

Thank you

IB Development Team

Hello,

See attached patch IB#1005297_search_results_wo_categories_1.zip for removing category list from manufacturer products list. Should be applied _after_ the IB#1005297_search_results_wo_categories.zip patch above. These two patches should remove category list from both: search results page and manufacturer products page.

Test before use in production please. Hope it helps.

Regards,
Pawel

IB Development Team
http://dev.ib.pl/

[attachment cleanup by admin]

armin17

Everything is working correctly. This is very useful. Thank you for your help.

Fonias

Hello there,

i want to remove the categories but i don't know how to install the patch.

Can you please tell me how to install this patch?


Thank you in advance!!

Λέβητες Στερεών καυσίμων
http://levites.gr/

RobertL

Never applied a .patch before, but here's how you do it manually. This is for removing categories from search results, haven't done the other yet.

Edit file components/com_virtuemart/views/category/tmpl/default.pfp   You can either save it in same location, or if you don't want it to be overridden by an update, you can put it in templates/YOUR_TEMPLATE_NAME/html/com_virtuemart/category/ and since those last two folders aren't there by default, just create them

1. Around Line 49
Original:
echo $edit_link; */ ?>
<div class="category_description">
<?php echo $this->category->category_description ?>
</div>
<?php


Replace with:
echo $edit_link; */
if ( empty($this->keyword) ) {
?>
<div class="category_description">
<?php echo $this->category->category_description ?>
</div>
<?php
}


2. Around Line 56
Original:
if ( VmConfig::get('showCategory',1) ) {

Replace with:
if ( VmConfig::get('showCategory',1) && empty($this->keyword) ) {


3. Around Line 136
Original:
<h3><?php echo $this->keyword?></h3>

Replace with:
<h2><?php echo JText::_('COM_VIRTUEMART_SEARCH_RESULTS') . ( $this->keyword ': ' $this->keyword '' ); ?></h2>

You can of course still use h3 tag if you want, this is just exact from .patch file

Last thing to do is to edit language file located in language/en-GB/en-GB.com_virtuemart.ini or whichever other language you use
Original:
COM_VIRTUEMART_SEARCH_ORDER_VIRTUEMART_PRODUCT_ID="Product ID"

Replace with (essentially just adding one more line_:
COM_VIRTUEMART_SEARCH_ORDER_VIRTUEMART_PRODUCT_ID="Product ID"
COM_VIRTUEMART_SEARCH_RESULTS="Search results"



That's it. Thanks to IB Development Team for the hack

Fonias

#6
Thank you veeeery much for your reply! You are very helpful! It works great now!

Thanks to IB Development Team and to you for the guidance. ;)


I have one more, small issue. I get this "Choose Product Type" field (Which is empty). Can you please tell me how to get rid of this?

Thank you again!

Fotis.

[attachment cleanup by admin]
Λέβητες Στερεών καυσίμων
http://levites.gr/

552288

Dear RobertL ..........

THX a lot for this helpful reply, im search long time for the solution, you make my day!

Greetz .... 8)

silkwork


andrew.glover

Thank You so much for supplying this amazing patch!

mowgs

Hi, can you give details on how to apply the .patch files?

I've changed all the details as shown in the above post, but still no change?

Using 2.0.6 and beez5 default template (amended)

karaoke

Hi ... Can somebody please explain how to use this patch?

karaoke

I've just tried this hack but it's useless. Nothing has changed on the search results page.

Menace

I'm using this thread for a related question.

How would I do it the other way round?
I'm looking for a solution for getting only Categories in VM search results and the products should not be listed. Is that possible somehow?

gcoulter

Hi

I got the first patch to work ok on ver 2.10 with a small edit.
You don't need the line
echo $edit_link; */
It no longer exists, code should look like this.

if ( empty($this->keyword) ) {
?>
<div class="category_description">
   <?php echo $this->category->category_description ; ?>
</div>
<?php
}
/* Show child categories */

if ( VmConfig::get('showCategory',1) && empty($this->keyword) ) {
   if ($this->category->haschildren) {

However I can't get the manufacturer patch to work.
Anyone got this working?

Thanks.
Graham Coulter
Ireland