Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi apollog,

    You’re correct–the plugin uses strings for most fields, and strings are sorted in alphabetical order. The only way to get numeric sorting is to use a number-based field for the data. What field settings are you using for the Price field right now? A screenshot would help.

    Thread Starter apollog

    (@apollog)

    The directory that I am trying to sort is: https://olssandbox.com/gateway/business-directory/

    Currently the price-related fields are set up as Post metadata / Textfield / No Validation (so I can add $ symbols when necessary).

    I have tried using Whole Number Validation, but that does not work when sorting either.

    In a perfect world, I could use a $ in the field and still have it sort numerically, but I am a long way from that working.

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi apollog,

    Once you add a string like $ to a field, it automatically can’t be sorted numerically. It has to be processed like a string. In an ideal world, we would have a price field that stored the data as a number (decimal) and the currency as a string separately and did the sorting that way. But BD doesn’t have support for that right now. String (lexical) sort is all we have at the moment. Sorry.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sort by Numerically’ is closed to new replies.