Home Forums WoodMart support forum Remove popularity filter

Remove popularity filter

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #531971

    josephdickinsonuk
    Participant

    Hey I want to remove the default popularity option? I only want the option “sort by popularity” removed, the rest can stay. See attached. How do I do this. Thanks

    Attachments:
    You must be logged in to view attached files.
    #532175

    Hello,

    Try to add the following PHP code in the function.php of the child theme.

    function my_woocommerce_catalog_orderby( $orderby ) {
        unset($orderby["popularity"]);
        return $orderby;
    }
    add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20 );

    Best Regards.

    #532180

    josephdickinsonuk
    Participant

    Thanks. I tried and tested it, and it is still showing. Attached is a screenshot.

    Attachments:
    You must be logged in to view attached files.
    #532526

    Hello,

    The problem has been resolved. I’ve incorporated the code into the function.php file of the theme, and the “sort by popularity” feature is now invisible. Please revisit your website after clearing your browser cache entirely.

    Best Regards.

    #533823

    josephdickinsonuk
    Participant

    Thanks. Just wondering on this, instead of hiding the popularity filter, what would be the php code to rename to Our Top Picks

    So it would work a popularity feature, but be named Our Top Picks, be the default filter

    #533918

    Hello,

    Navigate to Appearance > Customize > Woocommerce > Product catalog > default sorting.
    If you want to keep the popularity filter remove the php code. And if you want to change the text try to use loco translate plugin for this:

    Here is our article on how to use that plugin: https://xtemos.com/docs-topic/translate-woodmart-theme-with-loco-translate/

    Best Regards.

Viewing 6 posts - 1 through 6 (of 6 total)