Low search and search store
EE v2.10.1
Store v2.5.1
Low Search v4.3.1
I have two channels, collections and products. I use a playa field to select products for each collection.
Then the user will view all the products in that collection: domain.com/collection/name-of-collection
It will display the collection title and then I would loop thru the playa field to display the products that are in that collection.
I want to use Low search to filter the product results for that collection.
by Price (store:price) and color (store:mod:color) and I have not had any luck. I've tried all variations, including the query parameter in the results tag.
The only progress I've made is using
For Price
[code]{exp:low_search:results
channel="products"
dynamic="no"
parent:cf_collection_products="{segment_2}"
store:price="{segment_4}"
orderby="store:price"
sort="asc"
}[/code]
and for Color
[code]{exp:low_search:results
channel="products"
dynamic="no"
parent:cf_collection_products="{segment_2}"
store:mod:color="{segment_4}"
orderby="store:price"
sort="asc"
}[/code]
I've seen other posts about this in the EE stackexchange and on here as well, but none including the query parameter working, I only see mention of the store:mod and store:price parameters.
For the search form, I modified the form tag a few times, this is what I have now:
[code]{exp:low_search:form result_page="/collection/the-digit-collection" form_class="search"}[/code]
I hard coded the fields for price and color:
[code]
PRICE
up to $10
$10 to $25
$25 to $50
$50 to $100
$100 and up
COLOR
Red
[/code]
Any help is appreciated, thanks.
Replies
Low 17 Oct 2015 08:11
You can use the parameters Low Search Store makes available either hard-coded on the Results tag (not dynamic) or as input fields in the Form tag (dynamic) which will then be passed on to the Results tag with the query="" param (or with GET vars, if you're not encoding queries).
So, with store:price="{segment_4}" hard-coded, and if segment_4 equals "10", you should get products that are exactly 10 dollars.
If you're using the drop down options mentioned in the examples, you need to make sure the Results tag has the query parameter, eg query="{segment_4}" (where the segment points to the encoded query in the URI).
If you can't get it working, it's good to enable the output profiler and template debugger, so you can see what LS does. Copy/Paste all lines that mention LS here, and look up the queries it generates. That should give you some more insights, too.
Brad Morse 20 Oct 2015 17:25
Thanks, I was able to use mo variables to get it to work, thank you for the debugging and the encode option.