Is it possible to restrict a search to a particular price range?
(2004/03/11)Yes. The module can search for prices within a particular price range. To add this capability to the module, you need to use the "Use template formatting?" option (on the "options" tab).
Within the form in the "Main template" area (i.e. between the %beginform% and %endform%) you can place the token:
%pricerange1|xx|%
to display a search field, xx characters long, to collect the bottom of the range. Similarly, you use the token:
%pricerange2|xx|%
to display a search field, xx characters long, to collect the top of the range. The module will then restrict the search to only those products which have a price between the value entered into the two fields (actually, it will return all products which have a price equal to or greater than the value in %pricerange1|xx|% and lower than or equal to the value in %pricerange2|xx|%.
If no value is entered into the %pricerange2|xx|% field, then the search will return all products with a price higher or equal to the value entered into the %pricerange1|xx|% field.
The module will also take into account the other options and any search term entered into the search field. So if you enter "banana" into the search field and a price range of 0 to 30, the module would find only products in the price range from 0 to 30 AND with "banana" in the searched fields. However, it is not necessary that some value be in the search field (eg. not necessary that the form variable Search_search have a value). If not search term is entered, the module will return all active products in that price range.
By way of example, to offer your customers the ability to restrict the results to products with a price only within a particular range, you could add the following to your "main template" between the %beginform% and %endform% tokens:
Prices from: %pricerange1|3|% to %pricerange2|03|%
It's also possible to offer the price range capability by adding form fields directly to the template. You can use the variables, Search_pricerange1 and Search_pricerange2, to collect the data for the lower and upper price ranges, respectively. For example:
<input type="text" name="Search_pricerange1" value="">
<input type="text" name="Search_pricerange2" value="">
You can also use the variable, Search_pricerange (i.e. without the 1 or 2 suffix), which must have a value in the form "lower price:upper price". This is for use in Select type lists and radio buttons. For example, to offer the ability to select price ranges from a select list, you could add to the "main template" (again between the %beginform% and %endform% token) the html:
<select name="Search_pricerange">
<option value="0:10">$0 to $10</option>
<option value="10:20">$10 to $20</option>
<option value="20:30">$20 to $30</option>
<option value="30:">over $30</option>
</select>
NOTE that the price used is the value in the Products database for the product; it does NOT take into account discount for price groups, etc.
Last update: 2005-01-12 08:32
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:<select name="Search_and"><option value="1">All of the words</option><option value="0">At least one of the words</select>
- 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














