Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Sachyya

    (@sachyya-sachet)

    Hello @mauricevieth89

    Hope you are doing well.

    To make the filter items’ order not to change when clicked, you can pass a sortBy parameter to it. For that you can add the below code in your child theme’s functions.php:

    <?php
    function your_theme_slug_facet_modifications( $facet_settings, $facet ) {
         $facet_settings = [
             'sortBy' => ['name'],
         ];
    
         return $facet_settings;
     }
    
     add_filter( 'cm_typesense_search_facet_settings', 'your_theme_slug_facet_modifications', 10, 2 );


    It would need some extra customization to make it look like radio buttons. But you can make it behave like the radio button by changing the refinement type to menu with the code below:

    <?php
    function yout_theme_slug_change_filter_type( $filter, $post_type ) {
    	$filter = 'menu';
    	return $filter;
    }
    
    add_filter( 'cm_typesense_filter_type', 'yout_theme_slug_change_filter_type', 10, 2 );

    Hope this helps. Please let us know if you need further assistance.

    Regards

    Thread Starter Maurice Vieth

    (@mauricevieth89)

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Make the filter order not changing.’ is closed to new replies.