How can I modify the 'sort by' options on my ecommerce site?

Hey everyone,

I come here searching help as I am not a reader/writer of .liquid … and I am looking to modify a Shopify option : the sort by.

Currently, I have all the classical options : alpha, prices, best sellers and everything.

BUT… I do want to have only : Featured, by price (up and down)… and that’s it !

I am using the Kalles theme and I think I should modify the code in page “main-collection.liquid”.

Probably this code ?..

{%- when 'sortby' -%} 
            
            {%- assign sort_by = collection.sort_by | default: collection.default_sort_by -%}
              {%- assign option_selected = collection.sort_options | where:"value",sort_by | first -%}
              
                  
                  

                     

                     
                        {{'collections.general.sort_by_label' | t}}
                        
                     

                     
                        {%- for option in collection.sort_options -%}
                        
                        {%- endfor -%}
                     

                  

              

… I have looked a lot of other similar topic but it is never exactly the same code. And as I dunno how to correctly read it, I’m kind of blocked.

Any good help, please ? :slightly_smiling_face:

Nop ? :cry: