• How can I filter the results?

    My stores have different sized service-areas (in miles). The search results should only show those stores, if the specified position indicated is in the service-area.

    I would also like to add something like:
    if (distance > service-areas)
    return or (CSS) display:none

    if ( !$wpsl_settings['hide_distance'] ) {
            $listing_template .= "\t\t\t" . '<div id="text_distance" ><%= distance %>  </div>'. esc_html( $wpsl_settings['distance_unit'] ) . '' . "\r\n";
        }
    • This topic was modified 6 years, 6 months ago by nirna.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    How many service areas do you have? If there are not to many, then maybe simply create categories named after the service areas and let users filter on the names of the service areas through the dropdown?

    Thread Starter nirna

    (@nirna)

    I have many stores and every store has his own sevice area.

    The user shold only give a position.

    Later i would like to be able to extend that. For example, with the opening hours; only show stores that are currently open.

    Maybe can I somehow give ever list-element a Id like= “ListId” . distance – service-area .”

    And in js i can write if (id < 0) display: none
    ?

    Thread Starter nirna

    (@nirna)

    Is this not possible?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    You can try and use to use custom meta fields to list the service areas.

    Then use the wpsl_store_meta filter to remove those locations that don’t fall within the service areas.

    You can also use the wpsl_store_data filter to loop over the search results just before they are returned and modify them.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Filter store results’ is closed to new replies.