Miva Merchant 4 Module FAQs » Search Manager (BROK_SEARCH)
To add a "static" search field to your store you can use the code:
<FORM METHOD = "post" ACTION ="http://www.yourstore.com/Merchant2/merchant.mv?>
<INPUT TYPE = "hidden" NAME = "Store_Code" VALUE = "storecode">
<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "SRCHM">
<INPUT TYPE="hidden" NAME="Search_desc" VALUE="0">
<INPUT TYPE="hidden" NAME="Search_name" VALUE="1">
<INPUT TYPE = "hidden" NAME = "BrokSearch_Have_List_Fields" VALUE="1">
<b>Search for:</b><INPUT TYPE="text" NAME="Search_search" SIZE="15" VALUE="">
<input type="image" name="submit">
</form>
The "Search_desc" and "Search_name" variables represent the search options (i.e. search description and search name). A value of 1 means that field will be searched. The other fields:
Search_attrib
Search_weight
Search_desc
Search_price
Search_image
Search_thumb
Search_code
Search_name
Search_phrase
Search_case
Search_keys
Search_whole
Search_and
Search_ctgy
To search the fields of the Additional Fields Manager, you would use the field id (shown on the "Additional Fields" tab) such as:
<input type="hidden" name="SearchAdd_1" value="1">
where "1" is the field id.
It is also possible to provide a URL/Link which contains the terms to be searched:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=storecode&Screen=SRCHM&Search_name=1&HF=1&Search_Search=dog
As in the form above, the Search_name=1 means that the name field would be searched. You could add other fields by adding those to the url:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=storecode&Screen=SRCHM&Search_name=1&Search_desc=1&HF=1&Search_Search=dog
If you want to search a term w/ spaces in it you need to replace the spaces w/ +. So to search dog catcher you would have Search_Search=dog+catcher
It is actually possible to shorten the URL/form but it gets a little more complex. The search options are passed to the page in the variable SearchOptions, which is a "binary" representation of the options. So if ALL options had been selected by the customer it would look like 11111111111111. If only the AND option had been selected, then it would look like 00000000000010.
The positions, left to right, are:
Search_attrib position 1
Search_weight position 2
Search_desc position 3
Search_price position 4
Search_image position 5
Search_thumb position 6
Search_code position 7
Search_name position 8
Search_phrase position 9
Search_case position 10
Search_keys position 11
Search_whole position 12
Search_and position 13
Search_ctgy position 14
So to search the name and description you would have the URL:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=storecode&Screen=SRCHM&SearchOptions=00100001000000&HF=1&Search_Search=dog
Similarly, there is a string for the Additional Fields: AddOptions (eg. AddOptions=1|4). In this case the positions are actually the field ids (as listed on the Additional Fields Manager tab). So if you want to automatically search field ids 1 and 4, you would have AddOptions=1|4.
So to search Additional Fields 1 and 2 your URL would become:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=S&Screen=SRCHM&SearchOptions=00100001000000&HF=1&AddOptions=1|2&Search_Search=dog
This may seem longer than the original URL but that URL only searched the name field and this is as long as the URL will get regardless of the number of options you want to include.
{docurl}
Adding a Static Search Form
How do I add a static search form to my store, for example, on the store front?
To add a "static" search field to your store you can use the code:
<FORM METHOD = "post" ACTION ="http://www.yourstore.com/Merchant2/merchant.mv?>
<INPUT TYPE = "hidden" NAME = "Store_Code" VALUE = "storecode">
<INPUT TYPE = "hidden" NAME = "Screen" VALUE = "SRCHM">
<INPUT TYPE="hidden" NAME="Search_desc" VALUE="0">
<INPUT TYPE="hidden" NAME="Search_name" VALUE="1">
<INPUT TYPE = "hidden" NAME = "BrokSearch_Have_List_Fields" VALUE="1">
<b>Search for:</b><INPUT TYPE="text" NAME="Search_search" SIZE="15" VALUE="">
<input type="image" name="submit">
</form>
The "Search_desc" and "Search_name" variables represent the search options (i.e. search description and search name). A value of 1 means that field will be searched. The other fields:
Search_attrib
Search_weight
Search_desc
Search_price
Search_image
Search_thumb
Search_code
Search_name
Search_phrase
Search_case
Search_keys
Search_whole
Search_and
Search_ctgy
To search the fields of the Additional Fields Manager, you would use the field id (shown on the "Additional Fields" tab) such as:
<input type="hidden" name="SearchAdd_1" value="1">
where "1" is the field id.
It is also possible to provide a URL/Link which contains the terms to be searched:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=storecode&Screen=SRCHM&Search_name=1&HF=1&Search_Search=dog
As in the form above, the Search_name=1 means that the name field would be searched. You could add other fields by adding those to the url:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=storecode&Screen=SRCHM&Search_name=1&Search_desc=1&HF=1&Search_Search=dog
If you want to search a term w/ spaces in it you need to replace the spaces w/ +. So to search dog catcher you would have Search_Search=dog+catcher
It is actually possible to shorten the URL/form but it gets a little more complex. The search options are passed to the page in the variable SearchOptions, which is a "binary" representation of the options. So if ALL options had been selected by the customer it would look like 11111111111111. If only the AND option had been selected, then it would look like 00000000000010.
The positions, left to right, are:
Search_attrib position 1
Search_weight position 2
Search_desc position 3
Search_price position 4
Search_image position 5
Search_thumb position 6
Search_code position 7
Search_name position 8
Search_phrase position 9
Search_case position 10
Search_keys position 11
Search_whole position 12
Search_and position 13
Search_ctgy position 14
So to search the name and description you would have the URL:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=storecode&Screen=SRCHM&SearchOptions=00100001000000&HF=1&Search_Search=dog
Similarly, there is a string for the Additional Fields: AddOptions (eg. AddOptions=1|4). In this case the positions are actually the field ids (as listed on the Additional Fields Manager tab). So if you want to automatically search field ids 1 and 4, you would have AddOptions=1|4.
So to search Additional Fields 1 and 2 your URL would become:
http://www.yourstore.com/Merchant2/merchant.mv?Store_Code=S&Screen=SRCHM&SearchOptions=00100001000000&HF=1&AddOptions=1|2&Search_Search=dog
This may seem longer than the original URL but that URL only searched the name field and this is as long as the URL will get regardless of the number of options you want to include.
Last update: 2003-07-31 00:49
Author: Support
Revision: 1.0
You cannot comment on this entry
Records in this category
- Configuring a Search List to be Associated with ONLY One Field
- How to Log What Customers Search For
- Restricting a Static Search Form to a Single Category
- When Attempting to Rebuild my Databases, I get an error that the file can't be found
- The %begin_catrestrict....%end_catrestrict% token Displays the Category Code to the Customer. Won't that be Confusing?
- Restricting a Search to Particular Categories
- Displaying Category And Product Search Results Side-By-Side
- After Installing the Latest OpenUI Version, the Module Isn't Changing the Search Page Link in the Navigation Bar
- Malfunctioning Search Field Using %searchbox|xx|% and Search List Using %begin_searchlist%...%
- How to Insert a Product Quantity Box And Corresponding Add to Basket
- Adding a Static Search Form
- No results
- Searching additional fields...
- My products all have a $0.00 price and the price is added by one of my attributes (different price for each option). When searching by "price range" is there any way I can have the module search by the price of the attributes?
- I have the module configured but the search does not appear to be returning the correct search results. Any ideas?
- Can I keep a product from being included in the search?
- I would like to sort my products by their price. Especially used with the ability to search by price range (explained below) this would be handy. How can I do this?
- Is it possible to suppress the search form on the results page?
- Is it possible to restrict a search to a particular price range?
- Can I manually construct search links with the search friendly links from Copernicus including with additional product fields manager and price ranges?
- Is it possible to use search friendly links from Copernicus with Search Manager results including additional product fields manager?
- Is it possible to display the product links in the results without the "extra" variables in the URL?
- Is it possible to create an html drop-down that allows the user to determine the state of the AND flag?I've tried something like this, but it doesn't seem to send the correct state to the server:
- When I restrict a search to a particular category, it does not find products in sub-categories of that category. Why?
- I would like to sort my products by the order I have them set in admin. How can I do this?
- I know that you can search one particular category in a static search form, but how would I go about searching multiple categories?
- I am using Adam Denning's Additional Product Fields Manager module but the search isn't finding the data in the additional fields.
- I would like to make some checkboxes that essentially replace the search text box. in doing so, i would control the search terms. is there a way that i could make a text box that says "apple", and if they check it, and hit search, it will search my products for any that contain the word "apple", even if they don't type in any search terms themselves?
- When I use the search manager, is there any way to display the number of results, ie. "Items 1-20 of 257" or "114 products found"?
- I have a static search form. Is there any way to force the results to be sorted in a particular way?
- How do I keep the module from displaying "out-of-stock" products (I'm using the Merchant inventory feature to track inventory)?
- We would like to use your Additional Fields Manager to provide our customers with a set of select lists from which they can choose values to search for in each of the additional fields. For example we would have additional fields for:color size weight so they would select an item from three drop down select lists to choose a value to search for in the "color" field, for the "size" field, and the "weight" field. So they might search for something like:color="red"size="large"weight="4oz".
- Can I have a link that will display all products in a particular category which have a particular value in a certain field?
- I would like to conditionally display text on the search page. How can I do that?
- Right now if a value is stored in field 1 of product A, and field 2 of product B, both products A and B are returned. I?d like to configure it so that search list 1 searches only field 1, and search list 2 searches only field 2. Please let me know if there is any documentation about how I could associate each search list with only one field.
- Can I exclude products in certain categories from the search results?
- Can I display PAGES LINKS for Search Results














