Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1403449

    Hi all,

    I would like to remove some options (relevance, custom) from products sorting panel. Could you please tell me how can I?

    Thank you,
    Andu

    #1403475

    Hey andupro,

    Thank you for the inquiry.

    You can add this code in the functions.php file to adjust the options in the sorting dropdown.

    /*
     * Modify the default WooCommerce orderby dropdown
     * Options: menu_order, popularity, rating, date, price, price-desc
     * In this example I'm removing date & product id but you can remove any of the options
     */
    function avf_mod_woocommerce_catalog_orderby( $orderby ) {
    	unset($orderby["relevance"]);
    	unset($orderby["custom"]);
        return $orderby;
    }
    add_filter( "avf_wc_product_order_dropdown_frontend", "avf_mod_woocommerce_catalog_orderby", 20 );
    

    Best regards,
    Ismael

    #1403890

    Hi Ismael,

    Great. It works.

    Thank you,
    Andu

    #1403933

    Hi,

    Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.