• Welcome to KonaKart Community Forum. Please login or sign up.
 

How to search for products within a price range?

Started by ScottS, April 19, 2011, 12:01:51 pm

Previous topic - Next topic

ScottS

I'm trying to set up KonaKart and I have a question.

I need to set up a search query that will return products within certain price ranges.
I've seen this on many ecommerce sites. For example:

$10.00 - 49.00
$50.00 - 99.00
$100.00 - 150.00

Etc..

I have looked all over but can not find any information on how to do this with KonaKart.

Can you point me in the right direction?

trevor

You need to use the API call used when doing an advanced search. Take a look at AdvancedSearchSubmitAction.java. Here you can add price filters.

ScottS

I found the .java file that you are referring to.
Is there any documentation regarding as to how to do this?

trevor

No. It's a standard JSP / Struts / Tiles application so you really have to be familiar with those technologies and then it's relatively easy.

ScottS

I understand that this is a JSP / Struts / Tiles application.
I also have a grasp on the technologies.
Though I don't consider myself an expert.

However, This is a project to help me in building strength in these technologies.

Now, when I look at your demo store and look at the advanced search,
there is like you said a section to search by price from and to.

But...

No matter what values I put in there it comes back as no products found.

If that search worked, I'd be able to use that as an example of what I needed to do to make my
search query work but it doesn't.

This is what I need to find out.

Please help.

trevor

That's just because it expects some search text. In order for it not to require any search text you can make the following change in the action class:


           if (spf.getSearchText() != null && spf.getSearchText().length() > 0)
            {
                ps.setSearchText(spf.getSearchText());
            }