Filter by price not working

WordPress Business Themes Forums Version 7 Themes Real Estate Theme Filter by price not working

Filter by price not working

July 11, 2013
Pablo Pablo
  • Pablo
    Pablo
    Newbie 6 points

    I have created a search field “price” and would like to filter the results in descending order but it is not working. Maybe something wrong with the parameters added when clicking on the filter: “&orderby=meta_value&key=price&order=desc”

    This is the entire query: ?search-class=PPT_S-ppt_s&cs-all-0=&cs-price-1=&cs-price-2=0-200000&orderby=meta_value&key=price&order=desc

    Any suggestion?

    July 11, 2013 at 11:58 pm
  • Mark Fail
    Mark Fail
    Super Guru 12,812 points

    &orderby=meta_value&key=price

    this is wrong, it should be;

    &orderby=meta_value&meta_key=price

    July 12, 2013 at 6:12 am
  • Sean
    Sean
    Senior Member 199 points

    Also why don’t you set up the search for price so you have a minimum and maximum price?

    Then your visitors can search more specifically and the search results will return faster.

    July 12, 2013 at 8:02 am
  • Mark Fail
    Mark Fail
    Super Guru 12,812 points

    :)

    July 12, 2013 at 10:47 am
  • Pablo
    Pablo
    Newbie 6 points

    Hi Mark, Actually I took a look in the Shopperpress Demo and noticed the filter by price is exactly the same as used in Realtorpress theme:

    http://shopperpress.premiumpresslimited.com/index.php?cat=6&orderby=meta_value&key=price&order=desc

    I don’t want to use Min/Max price fields because it is easier to customers searching the property using one field instead of two in my opinion.

    I am using realtorpress 7.1.4 and WordPress 3.5.2 and was wondering if it can be related to:

    1. The mask used to the price. Example: R$458.950,00
    2. Some htaccess rewrite configuration

    I also noticed that when using the parameter “&order=asc” at the end it is sorting the property “Title” instead of “price”. Example: &orderby=meta_value&meta_key=price&order=asc.

    I appreciate any suggestion.

    Thanks.

    July 12, 2013 at 5:26 pm
  • Pablo
    Pablo
    Newbie 6 points

    Hi – I have opened a support ticket for investigation.

    thanks

    Pablo

    July 14, 2013 at 1:52 pm
  • Mark Fail
    Mark Fail
    Super Guru 12,812 points

    Hi Pablo

    Price values must be stored as numeric values to be searched correctly, so the price needs to be 100 not $100 (example)

    July 14, 2013 at 4:14 pm
  • Pablo
    Pablo
    Newbie 6 points

    Hi Mark,

    In order to fix this I had to change the file class_design.php and replace the parameter “key=” by “meta_key=” in the following lines as your suggestion:

    1) $cat.”&meta_value=yes&meta_key=featured&orderby=rand&posts_per_page=50″;
    2) meta_key=featured&orderby=rand&order=rand”;

    Also I have reviewed the prices values and deleted all comma and dot symbols.

    Thanks for the tips.

    Regards,

    Pablo

    July 15, 2013 at 9:37 pm
  • Mark Fail
    Mark Fail
    Super Guru 12,812 points

    Pablo nice work thanks for letitng me know

    July 16, 2013 at 2:09 am
Viewing 9 posts - 1 through 9 (of 9 total)

Didn't find what you were after?

Chat with us now

or contact our support team