0

I am trying to implement a simple "Virtuemart Only" search in one of the custom modules on a site. What I'd like is to be able to insert the search tags into an existing table in a mod_custom module. The problem is, I have no idea how to code an <INPUT> tag to work with VM.

Every Google search I've done returns solutions centered on either (1) installing the VM Advanced Search module, (2) using the basic VM Search module, or (3) using Modules Anywhere to load one of the previously mentioned modules into an existing space. Problem is, the site I'm working on doesn't need another module taking up space. It really just needs a simple <INPUT> field in a particular location that sends queries to VM.

Edit: To clarify my purpose, here is a partial of the source code I want to insert the search into:

<table id="product-search" class="product-search">
 <tbody>    
  <tr>
   <td></td>
   <td><span class="search-title">Order Online</span></td>
  </tr>
  <tr>
   <td><img src="shopping-cart.png" /></td>
   <td><**SEARCH CODE HERE**></td>
  </tr>    
etc... etc...

So you can see, it's just a simple table with some icons, phone numbers, etc., with the search <input> (hopefully) inserted in the middle of it.

I'm guessing I just need to add some stupidly simple code like:

<form action="administrator/components/com_virtuemart/html/shop.search.php" method="get">
Product Search: <input type="text" name="fname" /><input type="submit" value="Submit" />
</form>

Of course, I just get an error trying to directly access that particular script, so I'm wondering: Any VM gurus know how to code this?

4

3 回答 3

0

You're not going to be able to just insert a tag in to a mod_custom module, that's not how it works. Did you try the VM Advanced Search Module?

http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-search/8396

This takes the VM Adv search and puts it in a module. It should do what you need.

于 2011-05-25T23:27:01.347 回答
0

I managed to figure it out by scouring the page source for sites I know using VM (should have thought of that in the first place). The code is:

<div class="virtuemart_advsearch">
    <form name="adv_search" method="post" action="http://www.mywebsite.com">
        <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"/>
        <input type="submit" value="Search" name="search" class="button search"/>
    </form>
</div>

The <div> isn't really necessary, but it keeps things neatly divided for now. This is not the cleanest implementation, but it'll do for now.

于 2011-05-25T23:59:38.197 回答
0

If you want to search product only in your site then it will be better if you use default product search module in virtue mart. It will work fine.

于 2011-05-26T06:27:14.670 回答