Okay
  Public Ticket #2357297
Catalog Ordering
Closed

Comments

  • kirstenbraddock started the conversation

    Can I change the sorting list? I would like to remove some of the sort items.

  •  675
    Neuron replied

    Hi,

    I am very sorry for the late reply, we did not work on the weekend.

    Sure, you can achieve that by adding the following snippet in PHP.

    function filter_woocommerce_catalog_orderby( $array ) { 
        unset($array['menu_order']); 
        unset($array['popularity']);
         return $array; 
    }; 
    add_filter( 'woocommerce_catalog_orderby', 'filter_woocommerce_catalog_orderby', 10, 1 ); 

    This is the list:


    // [menu_order] => Default sorting
    // [popularity] => Sort by popularity
    // [rating] => Sort by average rating
    // [date] => Sort by newness
    // [price] => Sort by price: low to high
    // [price-desc] => Sort by price: high to low

    The code can be added at the bottom of functions.php in the child theme or via the plugin PHP Snippets.

    https://wordpress.org/plugins/code-snippets/

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.

  • kirstenbraddock replied

    No problem! Im just trying to work around my kids being home. :) 

  •  675
    Neuron replied

    Glad to know that you're safe, feel free to ask for anything you needsmile.png

    Kind Regards


    Subscribe to our newsletter to get the latest updates about NeuronThemes and join our community Facebook Group.