• Resolved mattbeard91

    (@mattbeard91)


    Hi, thanks again for your help on my previous question. I have one more question if that’s okay… I am trying to add a checkbox to a particular search form that would filter by Marketing flag. In this case to exclude “Let Agreed”. I have cobbled together the below but it returns no results when checked. Can you steer me in the right direction if possible? Many thanks!

    add_filter( 'propertyhive_search_form_fields_residential', 'edit_residential_property_search_form_fields', 101 );
    function edit_residential_property_search_form_fields($fields)
    {
        $fields['marketing_flag'] = array(
            'type' => 'checkbox',
            'value' => 73, // Let agreed marketing flag ID
    	'label' => 'Exclude Let Agreed'
        );
        
        return $fields;
    }
    • This topic was modified 2 years, 6 months ago by mattbeard91.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Property Hive

    (@propertyhive)

    Hi Matt,

    From what I can make out from your snippet, I’m not sure that would work, as by someone ticking the tickbox in the search form that would show them ONLY properties that are Let Agreed, would it not? Whereas you’re trying to exclude them, and only show available properties.

    Have you seen this doc which does something similar to what you’re after, the difference being the below gives people the option to include Let Agreed, instead of exclude them, but the logic could be flipped (and happy to advise if needed):

    https://docs.wp-property-hive.com/developer-guide/miscellaneous-and-snippets/add-include-sold-stc-checkbox/

    Let me know your thoughts,
    Steve

    Thread Starter mattbeard91

    (@mattbeard91)

    Hi steve,

    This is exactly what I needed. Not sure how I missed this in the documentation.
    Thanks again for getting back to me so quickly! Fantastic support!

    Many thanks,

    Matt

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter by Marketing flag’ is closed to new replies.