You are here:  » Search products within specified category and merchnt

Support Forum



Search products within specified category and merchnt

Submitted by clare on Mon, 2011-02-21 17:55 in

Hi David,

I am pretty sure this has been asked and solved before, but I can not find the relevant thread.

I have a form with select boxes that users can select a category, merchant and price range from. The selections are posted as variables so then what I wanted to do was make the action of the form to be a search query such as

site.com/search.php?q=category:CatName&merchant:MerchantName&bw:&minPrice=0.00&maxPrice=10.00

To return in the search results all products from the specified merchant, in the specified category within the price range.

From the threads I have read I think you previously made some mods that will allow for queries such as that, if so please could you direct me to the relevant thread.

Submitted by support on Mon, 2011-02-21 18:02

Hi Clare,

The version of search.php from the Sidebar Filters mod available on the Download Extras page will let you do that!

With that code online, you could make sure that your form:

a) submits to (has an action attribute) of $config_baseHREF."search.php", e.g.

  <form method='GET' action='<?php print $config_baseHREF?>search.php'>

and b), your merchant and category select boxes are named merchantFilter and categoryFilter

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by clare on Tue, 2011-02-22 14:17

Thanks yes I can now search
site.com/search.php?q=eye%20shadow&categoryFilter=Make+Up+Eyes&merchantFilter=Boots&bw:&minPrice=20.00&maxPrice=40.00

and get all eye shadows from Boots in the Eye Make Up category priced between £20-£40

The query
site.com/search.php?categoryFilter=Bath+and+Shower

does not show any results though.

I do not have the latest PT installed, I have the one before last installed, although have upgraded tapestry.php and search.php and searchresults.php. I was wondering if there is another file that I may need to upgrade for this to work on my site. Or maybe a search term has to be entered for the query, in which case is it possible to search "all".

Submitted by support on Tue, 2011-02-22 14:25

Hi Clare,

To show all results for a specific query, use

site.com/search.php?q=category:Bath+and+Shower

Cheers,
David.
--
PriceTapestry.com

Submitted by clare on Tue, 2011-02-22 14:29

Actually I just spotted something that I need to write the query like this...

site.com/search.php?q=category%3AMake+Up+Eyes%3A&merchantFilter=Boots&minPrice=20.00&maxPrice=40.00

So it will work perfectly on my site

Thankyou!

Submitted by clare on Tue, 2011-02-22 14:29

oops sorry, you are too quick..had already replied!!

Thanks David