News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

mod_virtuemart_search and cache problem

Started by gboul, May 23, 2012, 19:12:12 PM

Previous topic - Next topic

gboul

Hi,
I am using the mod_virtuemart_search with the cache enabled.
After clearing the cache the search is working fine. All subsequent searches it returns the results of the initial search even if you try to search from a different computer.

This is on Joomla 2.5.4 with Virtumart 2.0.6 & with browser IE8 and IE9. Only for IE I am using the module, for other browsers I am using a different ajax module.

If you want to try by yourself and see the problem, please visit the www.myebooks.gr.

gboul

#1
changed the default.php of mod_virtuemart_search and fixed the problem.
As you see in the following, I removed the JRoute from the action and replace it with just index.php. I added all the form parameters as inputs of type hidden.
I am not sure yet what the problem was , but I suspect that the original code was passing few form parameters twice.
Anyway that was a solution to my issue.
I wish i had the time to investigate this further, but there are a lot in the virtumart code that I still do not understand how it works.
I would be obliged if any of the moderators, verify that this is a valid solution or I should look elsewhere to fix the issue.

<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>

<!--BEGIN Search Box -->
<form action="index.php" method="get">
<div class="search<?php echo $params->get('moduleclass_sfx'); ?>">
<?php $output '<input style="height:16px;vertical-align :middle;" name="keyword" id="mod_virtuemart_search" alt="'.$button_text.'" class="inputbox'.$moduleclass_sfx.'" type="text" value="'.$text.'"  onblur="if(this.value==\'\') this.value=\''.$text.'\';" onfocus="if(this.value==\''.$text.'\') this.value=\'\';" />'
 
$image JURI::base().'component/com_virtuemart/assets/images/vmgeneral/search.png' ;
 

if ($button) :
    if ($imagebutton) :
        $button '<input style="vertical-align :middle;height:16px;border: 1px solid #CCC;" type="image" value="'.$button_text.'" class="button'.$moduleclass_sfx.'" src="'.$image.'" onclick="this.form.keyword.focus();"/>';
    else :
        $button '<input type="submit" value="'.$button_text.'" class="button'.$moduleclass_sfx.'" onclick="this.form.keyword.focus();"/>';
    endif;
endif;

switch ($button_pos) :
    case 'top' :
    $button $button.'<br />';
    $output $button.$output;
    break;

    case 'bottom' :
    $button '<br />'.$button;
    $output $output.$button;
    break;

    case 'right' :
    $output $output.$button;
    break;

    case 'left' :
    default :
    $output $button.$output;
    break;
endswitch;

echo $output;
?>

</div>

<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="category" />
<input type="hidden" name="search" value="true" />
<input type="hidden" name="limitstart" value="0" />
<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id ?>" />
  </form>

<!-- End Search Box -->


Thank you