Author Topic: shop.browse.php not displaying when no search results present  (Read 586 times)

joels341

  • Beginner
  • *
  • Posts: 3
Hi all-

I am having a strange problem and can't figure it out. I haven't seen anything like it posted before.

Whenever I try to search for products according to their product-type parameters and there are no results, I get a blank page. I see my template, but it doesn't display any part of the virtuemart component, not even vmMainPage.

If I go to shop.browse.php, around line 81, there is this line:
// when nothing has been found we tell this here and say goodbye

If I put an echo here, it does not display:
echo "test";

However, if I add a die() statement, like this:
echo "test"; die();

I get a white page that says "test". So I know it's getting this far.

It seems like there is some sort of buffer and nothing gets outputted unless I use die().

Anyone have any ideas?

Thanks in advance,
-Joel

joels341

  • Beginner
  • *
  • Posts: 3
Re: shop.browse.php not displaying when no search results present
« Reply #1 on: April 28, 2011, 00:40:14 am »
Nevermind, I figured it out.

Apparently when there are not search results to the parameter search form, Virtuemart kicks you back to the 'view=frontpage' part of the site.

Since I consider the frontpage to usually be the homepage, I didn't have <jdoc:include type="component" /> displaying there.

Is this a bug? Does it have to kick back to frontpage? I would except this to fall within the realm of the VM component, not the frontpage.

Oh well.

joels341

  • Beginner
  • *
  • Posts: 3
Re: shop.browse.php not displaying when no search results present
« Reply #2 on: April 28, 2011, 00:45:45 am »
For anyone who needs to check for the homepage and exclude virtuemart pages, here is the code:

Code: [Select]
<?php
           $IS_HOMEPAGE_PAGE 
false;

           if ( 
JRequest::getVar('view') == 'frontpage' && JRequest::getVar('option') != 'com_virtuemart' )
           {
                   
$IS_HOMEPAGE_PAGE true;
           }
?>


useris

  • Jr. Member
  • **
  • Posts: 224
Re: shop.browse.php not displaying when no search results present
« Reply #3 on: June 15, 2011, 14:10:14 pm »
Hi Joels341,

Great that you figured out this one. Could you tell which VM search plugin you're using?
If I understood you right now you can search by product type?

Kind regards,
Useris