WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Add a reset filter button in layered widget (3 posts)

  1. robertodimarco
    Member
    Posted 1 year ago #

    Hello,
    how can i insert this button inside the layered nav filter? Thank u!

    <?php
    $filterreset = $_SERVER['REQUEST_URI'];
    $filterreset = strtok($filterreset, '?'); ?>
    <a href="<?php echo $filterreset; ?>">Clear Filters</a>

    http://wordpress.org/extend/plugins/woocommerce/

  2. robertodimarco
    Member
    Posted 1 year ago #

    i'm using this code:

    add_action('woocommerce_layered_nav_link', 'your_function_name');
    
    function your_function_name() {
    // Your code
    
    $filterreset = $_SERVER['REQUEST_URI'];
    $filterreset = strtok($filterreset, '?');
    echo'<a href="'.$filterreset.'">Clear Filters</a>';
    
    }

    but is adding a link on every element inside the widget.

    P.S. sorry for my english!

  3. juri003
    Member
    Posted 1 year ago #

    Hi there,

    I am looking for the same functionality. Anyone?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.