VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: IB Development Team on April 25, 2012, 20:11:12 PM

Title: Search results without category list
Post by: IB Development Team on April 25, 2012, 20:11:12 PM
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]
Title: Re: Search results without category list
Post by: armin17 on April 25, 2012, 21:47:06 PM
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
Title: Re: Search results without category list
Post by: IB Development Team on April 26, 2012, 10:28:36 AM
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]
Title: Re: Search results without category list
Post by: armin17 on April 26, 2012, 17:25:42 PM
Everything is working correctly. This is very useful. Thank you for your help.
Title: Re: Search results without category list
Post by: Fonias on April 30, 2012, 21:12:13 PM
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!!

Title: Re: Search results without category list
Post by: RobertL on May 04, 2012, 10:52:29 AM
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
Title: Re: Search results without category list
Post by: Fonias on May 04, 2012, 23:22:25 PM
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]
Title: Re: Search results without category list
Post by: 552288 on May 05, 2012, 07:09:50 AM
Dear RobertL ..........

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

Greetz .... 8)
Title: Re: Search results without category list
Post by: silkwork on June 04, 2012, 09:58:12 AM
Thank you from me too!
Title: Re: Search results without category list
Post by: andrew.glover on June 08, 2012, 18:37:03 PM
Thank You so much for supplying this amazing patch!
Title: Re: Search results without category list
Post by: mowgs on June 13, 2012, 13:21:33 PM
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)
Title: Re: Search results without category list
Post by: karaoke on June 23, 2012, 20:44:58 PM
Hi ... Can somebody please explain how to use this patch?
Title: Re: Search results without category list
Post by: karaoke on June 24, 2012, 06:26:04 AM
I've just tried this hack but it's useless. Nothing has changed on the search results page.
Title: Re: Search results without category list
Post by: Menace on July 27, 2012, 13:51:20 PM
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?
Title: Re: Search results without category list
Post by: gcoulter on September 08, 2012, 10:45:00 AM
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.
Title: Re: Search results without category list
Post by: gxHL on October 01, 2012, 21:55:44 PM
Quote from: gcoulter on September 08, 2012, 10:45:00 AM
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.

Can you please explain the process on how to installing the patch please?
Title: Re: Search results without category list
Post by: krentzis on June 10, 2013, 15:57:44 PM
Hello,

I applied the first patvh but I don't see any difference.

You can see here www.choiceandattitude.com/demo what my problem is.

For example if you go to Menswear/T-Shirts you will see some products.

If you go to the footer and press o Clock for example you will not get any results simply because o Clock does not manufacture any t-shirts.

I have this module that displays manufacturers vertically so I dont know if that is the reason.

it was that link that produced the output
<?php foreach ($manufacturers as $manufacturer) {
$link JROUTE::_('index.php?option=com_virtuemart&view=category&virtuemart_manufacturer_id=' $manufacturer->virtuemart_manufacturer_id);


How I can display ALL products from manufacturer o Clock no matter in which category I am ?


thanks

Title: Re: Search results without category list
Post by: friends1976 on September 03, 2013, 21:46:57 PM
This worked perfectly for me.  There is one problem, though, that the new formatting isn't using my template anymore.  Is there any reason why? 

http://www.omegasports.net/index.php/component/virtuemart/manufacturer/balega

Quote from: RobertL on May 04, 2012, 10:52:29 AM
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