[Resolved] Clear all selected options for woocommerce filters

Home Forums Support [Resolved] Clear all selected options for woocommerce filters

Home Forums Support Clear all selected options for woocommerce filters

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

    Hi,

    When customer select some filters they have to click all to remove them. https://prnt.sc/20e28es
    Is there any way to add clear all of my selections?

    #2013594
    Leo
    Staff
    Customer Support

    Hi there,

    Unfortunately this is something you will need to check with WooCommerce’ support team as the filter is coming from the plugin itself.

    Thanks for your understanding.

    #2013640
    roadlink

    Hi Leo,

    thanks it is fair.
    Actually i find a way to make it.
    Add below code to funtions.php and add [cleanthemall] shortcode under your selections widget.
    Maybe some others may need it.

    I just couldn’t solve extra line here. https://prnt.sc/20e69c7
    If someone give me suggestion we can make the code perfect ๐Ÿ™‚

    
    /*Clean active filters, Use this as a shortcode [cleanthemall]*/
    add_shortcode( 'cleanthemall', 'cleanthemall' );
    function cleanthemall() {
    $filterreset = $_SERVER['REQUEST_URI'];
    if ( strpos($filterreset,'?filter_') !== false | strpos($filterreset,'?min_price') !== false | strpos($filterreset,'?max_price')) {
     $filterreset = strtok($filterreset, '?');
     echo '<div class="clear-filters-container"><a id="woo-clear-filters" href="'.$filterreset.'">Clean All Filters</a></div>';
     }
    }
    #2013650
    Leo
    Staff
    Customer Support

    I would recommend asking the question like this in a general WordPress forum to get more audience:
    https://wordpress.stackexchange.com/

    Thanks for your understanding ๐Ÿ™‚

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