Range Sliders based on Particular Taxonomy Chosen

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Range Sliders based on Particular Taxonomy Chosen

This topic contains 15 replies, has 2 voices, and was last updated by Bruce Griggs Bruce Griggs 5 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #13175
    Bruce Griggs
    Bruce Griggs
    Participant

    Good Day,

    To begin with, I absolutely love the plugin and was going to buy a different one but at the last moment stumbled across this one and I am so happy that I did – So, awesome work!

    Now to the nitty gritty ?

    There is one feature which I have forgotten to check but I am very sure you can help out here, here’s a background of what my website does and what I need from the Ajax Search Pro Plugin…:

    Ok so I have a Real Estate website. Obviously the website is used with the Ajax Search Pro in order to search Taxonomies and Custom Taxonomies. My issue comes with a Property Status Search, what happens is that I have Taxonomies called “For Sale”, “To Rent” and
    “Accommodation” – Properties For Sale could have a price tag of say R 40 000 000 and an Accommodation Price Tag could be as low as R 400 per night. My issue comes with the range sliders, as you can imagine, if I were to set this up, the major margin between 400 bucks and 40Mil. So sliding up and down could be almost impossible.

    My previous (or current) solution allowed an Ajax change in my sliders currency amount based on what Taxonomy Status was selected. If I were to select “To Rent”, then my slider values would show only the amounts within the “To Rent” Taxonomy, if “For Sale” it would change to those values, etc.

    I do think you get the point though. Although that search has quickly become obsolete to my website and needs, it is the one thing that it has done well.

    Is there a way or a solution or suggestion to have something similar with my plugin (AS Pro). Or maybe I am missing something and it already does this feature automatically.

    I have thought of a work-around but it would require the whole page to refresh, and of course, this being a powerful AJAX Plugin, I would like for it to do it on the fly.

    If not, I am sure you can find the reason why this would be beneficial to the plugin, not just in my case but other websites would find it useful too such as classifieds with multiple types of products ranging from 20 Dollars to $100 000.

    Other than this, I am so incredibly happy with the plugin, again, good work and I am busy building it into my website as we speak, and very excited too ?

    Holding Thumbs for a solution ?

    Enjoy your day and let me know of the above.

    #13180
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much for your kind words!

    In this case I believe the best solution would be to use 3 separate search instances instead of one. One for each category – accomodation, to rent and for sale. They can be exactly the same, but each one configured to search exactly that one category, and of course the different price range.

    Then I would place each search shortcode one into some kind of tab shortcode (each one into different tab panels), and the labels would be the categories (for sale, to rent, accomodation). Then clicking on the tab labels would switch the search engines visible, thus solving the issue.
    I’m not sure if your theme has some kind of tab with labels solution, but that should not be too hard to create. Visual editors usually have one, and some themes as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13182
    Bruce Griggs
    Bruce Griggs
    Participant

    Hi Ernest,

    Thank you for your quick response! That is the workaround that I was thinking of as well, but wouldn’t it need to refresh the page when checked?

    Also, I have found another solution which seems to maybe make a bit more sense to my needs (or rather I think it will be more user friendly).

    In the Custom Fields, I have used the “Text” field item. The only issue I find is that some clients will put in for example: “R2000” or “2000” to “R 40 000 or 40000” or whichever combination of currency. The issue is that my Real Estate Plugin saves the custom taxonomy price as precisely for example: “R40,000”

    So as a result, unless my customer types in the price exactly like the above, the search result won’t show. A solution I think would be to create an auto correction so if they type “40000”, it automatically corrects it to “R40,000”

    Sorry for doing this to you, but is there a way that I can allow the plugin to do this?

    If not, I am going to use your suggestion with the range sliders, and I do thank you very much for the explanation as though I was thinking the same, I hadn’t though of using my Visual Composer which makes perfect sense πŸ™‚

    Let me know,
    Kind Regards.
    Bruce

    #13186
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Bruce,

    Thish shouldn’t be too complicated, but I’m not sure you know that in this case only results exactly matching the price would be returned. Since the values are stored in a ‘R40,000’ format, it’s considered as text by the database, and operators like ‘lower than’ and ‘greater than’ will not work at all – only the LIKE text operator.

    If that’s okay with you, I might be able to suggest a solution.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13187
    Bruce Griggs
    Bruce Griggs
    Participant

    Well this is why I am thinking that maybe somehow I can add some code that would sort of autofill their input. Almost like when you have to enter your telephone number in certain websites, so you just keep typing your number (regardless of format) and the input form automatically populates the input data to the correct structure…

    But I am very open to a solution if you have… You are kind of the smarty here, I’m just using your tool to make my website look good πŸ˜‰ haha…

    Something else that popped up and please let me know if I should open another ticket for it is: In the results page (not the results tab by the search)… am I able to allow the prices to show under the header of the post or is this a different matter dependent on my theme (in other words, me needing to do some coding in my core files).

    Again, thanks for the response!

    #13206
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    Are you sure that the storage method for the price is not numeric and is stored as ‘R40,000’ in the database?

    In this case, I believe the best solution is not an input validation on the front-end, that could take ages to get right – to check the first character, then check for thousand separators etc..
    Rather, I would recommend validating the data right before it’s sent to the database, like so:

    This filter will transfer any input to a numeric value, then format it to ‘RNN,NNN’ format with the thousand separator. I haven’t been able to test this with all cases, but it should work. Don’t forger to change the $meta_key variable to the meta key that is used for the price filtering.

    Please also be careful when making changes to your server files! Always have a back-up just in case.

    If you need help with this, let me know. I’ve also looked up the range slider documentation, and there might be a possible solution to change the slider values based on another field selection, like the built in search has. For that I will have to see a somewhat completed search instance to be able to suggest, as the customization depends on the structure of the HTML output. Let me know if you are interested, I will look into it for you.

    The results page layout and individual items content is not affected by the plugin, as it can’t be. There is no exact support for that yet in wordpress unfortunately. Some filters may work, but that again depends on your theme as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13220
    Bruce Griggs
    Bruce Griggs
    Participant
    You cannot access this content.
    #13221
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13222
    Bruce Griggs
    Bruce Griggs
    Participant

    Of course, I also think it is much simpler than going back and forth without you seeing what’s cooking.

    Let me do this.

    I am going to set up a subdomain where you can do some testing.
    I will set it up for you and add two properties.

    I will start with it now and, give me say, an hour or so and I will send you the login and the FTP details…

    Hang ten, will get back to you shortly…

    #13223
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Great!

    Let me know πŸ™‚

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13229
    Bruce Griggs
    Bruce Griggs
    Participant

    Sorry for the wait Ernest,

    My Hosting Company is creating the extra WP installation..it’s taking a bit long but you’ll receive the details as soon as I’m done.

    Kind Regards

    #13230
    Bruce Griggs
    Bruce Griggs
    Participant
    You cannot access this content.
    #13235
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much.

    I have good news. The price is nicely stored as a number in the ‘real_estate_property_price’ custom field, makes it really easy to filter it.

    What I did was the following:
    – I’ve made a ‘price from’ and a ‘price to’ input filters on that field, you can check them on the back-end: From price and To price configuration
    – This was already working, but of course it allowed non-numerical values, so I’ve quickly made a both front-end and back-end input validation script, now you can test the final form here: http://bookingzone.co.za/
    – The custom code can be found in the public_html\wp-content\themes\twentyseventeen\functions.php file from lines 12 to 56. You will need these in the production environment as well. I have copied these lines into this gist as well, you can copy it from there as well (copy from line 3).
    You need to add these lines to the functions.php file in the active theme directory.

    And basically that’s it, very simple, but working input validation and filter.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #13237
    Bruce Griggs
    Bruce Griggs
    Participant

    Sir Ernest Marcinko,

    I am certainly impressed and at the same time super grateful!
    You should be knighted for superfast coding. I love what you have done, and that, my friend deserves a HAPPY CELEBRATION!

    Thank you very much, I may (or not) bother you here and there in case I have any issues but that is all I needed. I can see that it works, now it is just up to me to get my stuff sorted based on your example.

    You truly rock, and you are a rockstar, thank you so much!
    I definitely learned today as well, which I love.

    I will give you feedback but I know everything will be ok!
    Enjoy your evening (well eve in South Africa)

    Kind Regards.
    Bruce

    #13238
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Dear Bruce,

    Thank you very much for your kind words, I’m happy I’m able to help you with this πŸ™‚

    I will leave this ticket open for now, in case you have any more questions.

    If you like the plugin, feel free to rate it on your codecanyon downloads page, it’s greatly appreciated.

    Greetings from central Europe (Slovakia)!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.