• Hi guys,
    I’ve got 2 parents store categories (Diesel and Loyalty) and each category has a bunch of sub categories. Users will only ever sort by a single category ie. Diesel > Type 1 or Loyalty > Type 3 etc.
    I’d like to separate the categories into 2 separate dropdowns though – one for Diesel and its subcategories and one for Loyalty etc – which one the user chooses the use to filter will disregard the other as nothing is selected. Is this achievable? I’ve used your suggestions to set the category dropdown to only show the children etc but not sure how to fire just one dropdown or the other?

    add_filter( 'wpsl_dropdown_category_args', 'nm_custom_dropdown_category_args' );
    
    function nm_custom_dropdown_category_args( $args ) {
    
        if ( is_page( 'diesel' ) ) {
            $args['parent'] = 6; // parent category ID
            $args['hierarchical'] = true; // only show the child categories
        }
    
        return $args;
    }
Viewing 1 replies (of 1 total)
  • Hi there,

    The behaviour you are describing is more like displaying the categories as checkboxes than it is doing it via dropdowns, in the sense that you can display multiple items when using checkboxes, whereas the dropdown is designed to be unique and it has a lot of internal references to its #id, so I don’t see an easy workaround for this.

    Even in the documentation for wpsl_dropdown_category_args there are only references to ONE single dropdown that you, of course, can higlhy customize. But not to the extent of splitting it into TWO different dropdows.

    I have been thinking about this for a while and there is no workaround that comes to my mind for this, sorry about that ??

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Second Filter Dropdown’ is closed to new replies.