Author Topic: Help needed tweaking Advanced VM Search module  (Read 4760 times)


  • Beginner
  • *
  • Posts: 2
Help needed tweaking Advanced VM Search module
« on: May 13, 2011, 07:31:40 AM »
Hi guys.

Am madly putting the finishing touches on our business website and am trying to get a VM search tool in place. Now I came a across this little module:

Now this ALMOST covers everything that I need (certainly shows up VM's own search tool!) with one not-so-minor drawback... whilst it includes Product Catagories in its search query, it DOESN'T include Product Types. In the case of our website, that's a lot of potential search data going to waste.

Will post the code from the module here... I'm trying to learn as I go here, but am not all that savvy with the back-end coding, esp PHP. Any help on this one HUGELY appreciated.

Code: [Select]
* VirtueMart Advanced Search Module By Sharif Mamdouh

defined('_JEXEC') or die('Restricted access');

$moduleclass_sfx $params->get('moduleclass_sfx');


<!--BEGIN Search Box -->

<div class="virtuemart_advsearch<?php echo $moduleclass_sfx?>">
                              <span class="isearch"></span>
$url = & JURI::getInstance();
$db = & JFactory::getDBO();
$query "SELECT `c`.`category_name` AS `name` , `c`.`category_id` AS `id` FROM `#__vm_category` AS `c` ORDER BY `c`.`category_id`;";
$categoriesListt $db->loadObjectList();

                              <form name="adv_search" method="post" action="<?php echo $url->root(); ?>">
                                    <input type="hidden" value="shop.browse" name="page"/>
                                    <input type="hidden" value="com_virtuemart" name="option"/>
                                    <input type="hidden" value="9999" name="Itemid"/>
                                    <input type="text" size="20" name="keyword1" class="inputbox"/>
                                    <select name="search_op" class="styled_short">
                                          <option value="and">AND</option>
                                          <option value="and not">NOT</option>
                                    <input type="text" size="20" name="keyword2" class="inputbox"/>
                                    <select name="search_category" class="styled_long" style="width:140px">
                                          <option value="0">Search All Categories</option>
                                          <?php foreach($categoriesListt as $row) : ?>
                                          <option value="<?php echo $row->id?>"><?php echo $row->name?></option>
                                          <?php endforeach; ?>
                                    <select name="search_limiter" class="styled_long">
                                          <option value="anywhere">Search all product info</option>
                                          <option value="name">Product name only</option>
                                          <option value="cp">Manufacturer/Vendor only</option>
                                          <option value="desc">Product description only</option>
                                    <input type="submit" value="<?php echo JText::_("SEARCH"); ?>" name="search" class="button search"/>
<div align="right" style="color:#999;margin-bottom:3px;font-size:9px">By i<a target="_blank" class="external" title="web design company" href=""><span style="color:#999;margin-bottom:3px;font-size:9px" >Web Design</span></a></div>
<!-- End Search Box -->


  • Beginner
  • *
  • Posts: 2
Re: Help needed tweaking Advanced VM Search module
« Reply #1 on: May 16, 2011, 00:36:59 AM »
Anyone able to offer assistance in this??


  • Jr. Member
  • **
  • Posts: 224
Re: Help needed tweaking Advanced VM Search module
« Reply #2 on: June 15, 2011, 14:01:23 PM »

I need this function too I have posted many new topics about this but noone seems to have a solution. But I will lookinto your code.
Meanwhile you can try to create product type menu link index.php?option=com_virtuemart&page=shop.browse&Itemid=65&product_type_id=1