Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22357

    Is there any way to remove the By Price element from the dropdown in the product pages?

    Thank you. :)

    Stuart Dutton

    #115527

    Hi Stuart,

    While it is possible, I don’t know the function off hand for removing one. I’ve only ever added to it (reference: https://gist.github.com/mikejolley/1622644).

    I’ll tag Peter on the topic and see if he has knows of the filter and a function for it.

    Regards,

    Devin

    #115528

    Try to add following code to functions.php (at the very bottom):

    add_filter('woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby');
    function custom_woocommerce_catalog_orderby($sortoptions) {
    unset($sortoptions['price']);
    unset($sortoptions['price-desc']);
    return $sortoptions;
    }

    #115529

    didnt seem to work but may be putting it in the wrong place,, could you be a bit more specific.. is there any additional arguments I need to add or any specific action these need to sit under or do I just paste it pas all the other lines in functions.php.. also does this go in functions.php or functions-replete.php. ?

    Thanks

    #115530

    You can add it to the bottom of functions.php. If it still doesn’t work I’d contact the woocommerce support team: http://www.woothemes.com/support/ – they should be more familiar with the woocommerce hooks/filters.

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

The topic ‘Remove Sort by Price from Dropdown’ is closed to new replies.