Code

Discussion on Filter Everything | WordPress/WooCommerce Product Filter

Discussion on Filter Everything | WordPress/WooCommerce Product Filter

Cart 15,697 sales
Recently Updated

Stepasyuk supports this item

Supported

This author's response time can be up to 1 business day.

8971 comments found.

Good afternoon I would like to know how long the license lasts or if I buy it I will have it forever

Hi facturasceragro,

Thank you for your interest in the Filter Everything plugin.

It’s a lifetime license.

Best Regards,
- Victor

I would like to show the visitor, based on the category in which he finds, only specific products, perhaps based on the “brand” or “processor type”, obviously if we are, for example, in the IT category. When the user then clicks on another category, for example TV, I would like to show the “brand” (it would be an attribute) of TVs only and not of PCs, coffee machines, etc. Also, to give the user the possibility to make a multiple selection, is it necessary to insert the reset and enter keys?

Hi gennarosalvi,

It’s simple if you have product categories like TV/PC/etc. You place certain products in those categories with certain attributes only. Choose in the filter set setting to hide empty terms and hide empty filters. And in the filter widget, you’ll see only the attributes for the products that you have in the current category.

Yes, in “Apply Button” mode you can choose a couple of filter terms and only then hit Apply to filter the products.

Best Regards,
- Victor

Hello Vittorio, must the attribute name be unique? For example, in the case of the “brand”, I use the same attribute name for all the brands of the products I have on the site, for example if I go to computers or notebooks, I would not like to see the brands of coffee, e-bikes, etc.

Also the filter never filters our product pages, I’m afraid I misunderstood the URL prefix issue. In my first set I wrote informatics11.

Please check the following link:

https://www.just-click.it/product-category/informatica/#

The filter widget will show only brands that are available for the products that are placed in the current category. So if PC and Notebooks have a brand Apple it will be shown on both categories but it will filter only products that are placed in the category PC or Notebooks and it will display different counters depending on how many products are in those categories. If you on the category Shoes it will show brands only for shoes.

Try to change the query in the filter set settings in the “And what to filter” dropdown and hit update then check if it is filtering normally.

Best Regards,
- Victor

Hello again, I wrote to you yesterday about the filter settings, I probably didn’t explain my problem enough, I have an attribute of the starting current, where the values start from 270 and go up to 1500, there is filtering only by alphabet, attribute id and number of records (screenshot https://imgur.com/a/i019SXE). Alphabetical filtering suits me, the only thing is that values ​​of 1000 and above go up, since they start from 1, how can I make the filtering start from the smallest number and end with the largest, thanks in advance for the answer!

Hi AmperBender,

We tested it with custom fields and attributes and here is what we get:

This is what we have before applying the sort – https://prnt.sc/BZKzCzfLmZE_

We set the term name “abc” sorting – https://prnt.sc/p68e0gYvGJ0a

And here is what we get – https://prnt.sc/E6KHo7og-ido

So perhaps the issue is that some of them are numbers and some of them text, serialized values and that’s why it is sorting it wrong.

Also, with attributes – https://prnt.sc/Qyqb71tuIknQ and after sorting – https://prnt.sc/Q3jIgIYLaY-9

Best Regards,
- Victor

Hello! I use WP 6.3 The first problem is that the FE widget does not appear in the blocks collection so I can add it in the page where I want the filters to appear. The second problem is that in the “And what to filter” field the only option is “no WP Queries matched the post type… found in this page”. I have created a custom post type with ACF which I want to filter. Thank you.

The Twenty Twenty-Three theme doesn’t support classic widgets. You can use the shortcode [fe_widget] to display the filter widget, more about shortcodes you can read here – https://filtereverything.pro/resources/shortcodes/ But the sorting widget won’t work as it needs the widget area to customize the sorting options.

Best Regards,
- Victor

Sorting is not necessary for me so it’s ok. The [fe_widget] made the filter checkboxes appear but I really need your help on how to make it function. Where should I place the shortcode in regard with the query loop? Inside the Query loop or somewhere else? I tried clicking the checkboxes but the filtering does not work. You can see the structure here: https://ibb.co/KFjY1NW

Hi evanv_yt,

The shortcode should be placed anywhere on the page or if you want after the header if you are adding it to the page template. But definitely not inside the query. And choose from the filter set settings and in the “What to filter” choose the needed page with the shortcode and the products.

Best Regards,
- Victor

Hey Victor,

the filter is not working here “https://hagan.waas.works/tourenski” since we removed the URL-Slug ”/kategorie/”.

My guess is that plugin does not know that it is on a category, because of it. The customer insists that this is solved.

So any idea if we can fix that? Maybe a rewrite with functions.php?

Kind regards Bernhard

Hi Bernhard

We have checked the site and found that the problem is in the Weglot plugin itself, which generates translation links in a rather non-standard way.

It doesn’t do it classically by hooks of some functions related to links. We looked at the code of the plugin Weglot and our assumptions were confirmed. Before displaying the page in the browser, it catches it into the buffer, finds all occurrences of <a></a> tags in the content and replaces all links there with translation links. And so it “translates” <a></a> tags, but not <input> tags (it catches the content in the buffer, replaces the links and returns the page to the browser).

We cannot influence this, and the only correct way is to contact Weglot support and ask them how to fix this situation. Maybe they have an alternative way to translate those links, or some way to add other tags to that translation. Plugin support should tell you how to add custom elements to the translation of links in them.

Here you can see the issue – https://prnt.sc/jAL7ZxRGx_g2 it is changing the <a></a> link but not the <input> link.

Best Regards,
- Victor

Thanks for you input, we pass the feedback on to weglot.

I have one more request for the future… Please ask us for a staging before modifying the website (https://prnt.sc/WQ0ZEYqUGENv // https://prnt.sc/lrcVq_MDZbsy), because a order is missing now. We already are on it and also saw a backup within WordPress was made: https://prnt.sc/xZt1CB9QTkZF

But we already have a backup system. So all good but please don’t do it without asking, we can create a staging at any time.

Hi nnpro

Certainly! Apologies for any inconvenience it caused. We appreciate your understanding. To ensure a smooth process, we typically generate a database backup using Updraft and temporarily deactivate certain plugins. This way, in the rare event of any issues, we’ve got the backup ready for a quick recovery.

Best Regards,
- Victor

Hello,

Our developer installed Filter Everything Pro on our website but the filter box is appearing on pages where the filter sets are not set up or required, i.e. ‘All products’ and search result pages. we have a grey box appear with ‘Filter’ in it (https://www.gdrectifiers.co.uk/all-products/) How do I remove these?

We also have terms appearing in a dropdown that return 0 search results. how do we remove them from appearing in the dropdown list? https://www.gdrectifiers.co.uk/stocklist/ (i.e. Anysolar dropdown search)

All of our dropdowns are not displayed in alpha-numerical order as desired, How do we change this? Throughout our site, we require all drop-down to be sorted alpha-numerically, some terms will just be numbers, others will be a combination of numbers and letters. https://www.gdrectifiers.co.uk/product-category/heatsinks/heatsinks-in-stock/

Under Appearance > Widgets we have very limited information under the Filter Everything plug-in. All we can see is ‘show selected terms (chips)’ and ‘show number of posts’ tick boxes. No widgets have been added here, what do we need to add as a minimum?

Thanks, from a very non-technical customer :)

Hi sarahl125,

Try to turn on this option and check if it will disappear -https://prnt.sc/n67OTajSdARr

Best Regards,
- Victor

Hi Victor,

Thanks for coming back to me.

A filter set is not currently created for this page, a generic filter set was originally created which I then deleted to see if that would remove these filter boxes but it didn’t. So now, we still have the filter boxes on the ‘All products’ page where there isn’t actually a filter set created for it.

Hopefully that makes sense? How do we remove it?

Thanks, Sarah

Hi Sarah,

Ask your developer if he added this by himself in the widget area – https://prnt.sc/GX0sZycvLrcI because it is not connected with the filter widget at all. It looks like a simple HTML code in the widget area.

Best Regards,
- Victor

Hi,

I have a problem with the plugin PRO.

So, the problem is that the plugin doesnìt work with my Shop Page.

In “Apply filtering if the page is:” I selected “Common Wordpress Pages” (I also tried with “Pages) and then I selected Shop Page. At this point, in “And what to filter?” I can select nothing. The only thing that appears is —Select Query -- and I can’t choose anything. I tried with the Product Categories instead, and it works. I tried also to delete the Shop Page and recreate, but the problem is still there.

The only thing I noticed and maybe can help to debug: If a Choose Taxonomy->Product Categories and then I choose “Product query. Main query”, if NOW i go to “Common Wordpress Pages”->Shop page, Now I see the option “Product query. Main query” here. But if I save, and then go to the Shop page, the filter appear but all the taxonomy are at 0 products count.

Thank you for fixing that, what we see is that you didn’t fix the /index.php/ since it is related to the .htaccess file of the site – https://prnt.sc/YTf-hAuxFvUa If you choose the “post name” it will filter normally on the shop page or category pages.

Top reasons why it isa bad to use /index.php/ in the URL

1) SEO Impact: Including ”/index.php/” in URLs can lead to duplicate content issues, harming your website’s search engine rankings.

2) Caching: Some caching mechanisms might not work well with URLs containing ”/index.php/”.

3) Compatibility: Some plugins or themes might not handle URLs with ”/index.php/” correctly.

4) Permalink Structure: ”/index.php/” clashes with the typical WordPress permalink structure.

5) Server Compatibility: Some servers might not handle ”/index.php/” correctly or require special configuration.

6) Database Queries: ”/index.php/” can influence how database queries are processed.

7) WordPress Updates: Future WordPress updates might not fully support ”/index.php/” URLs.

8) AMP Compatibility: AMP pages might not work well with URLs containing ”/index.php/”.

Best Regards,
- Victor

Hi, I did what you said and the filter now works! We’ll see if SEO will be hurt by my changes… Now I have 2 question: 1) My filter is an OR filter. But if I click on France (ex.) I can click also Italy and so it will create an url france-or-italy. I need to create a real OR filter. So if I change my filter, it will load another url, other products ecc. Ex. If I clicked France, if I’ll click Italy the filter must filter only Italy. So, basically, I want what do with Radio Button but with the checkbox style (now you see the radio, but it’s not what I want). 2) I put H1, Title and meta and descrption in “France” attribute and I see it’s displaying something from description, but it’s behinf the products. Can you help me via CSS to display it correctly above the products?

Hi michaelcodogno,

1) You should choose AND logic for it and it will work exactly as you need.

2) It would require editing the page template that corresponds to displaying that page, and you need to simply move that description in the code after the header or where you need it to appear.

Best Regards,
- Victor

Good afternoon, I have a problem with the filter, it filters values after 1000 incorrectly, throws them at the top of the list, please tell me how to solve this issue

https://imgur.com/dZYpDnf

Hi AmperBender,

Thank you for choosing Filter Everything PRO.

So if we understand correctly the filter is working and filtering as it should, the issue you are facing is that the filter terms are not sorted as you would like them to be sorted? You can change that in the needed filter by clicking “more options” and choosing the sorting option.

Best Regards,
- Victor

We are using the Pro plugin to display a set of three filter dropdowns, with the matching Posts listed underneath. This works correctly on the current hosting, but as soon as we move to another host (either online or in a local dev environment) then filter stops working. There is no error, and the results count shown next to the dropdown filter boxes is correct (e.g. “6 posts found”) but the list of posts continues to show everything and the filter is ignored.

Hi samiramohamed,

Thank you for choosing Filter Everything PRO.

Well, most likely it is the wrong query in the settings. Did you try going to the filter set settings and specifying the correct one? (“And what to filter” dropdown) Or maybe it is trouble with product importing and they need to be re-updated with the correct options. Also, check if there is nothing in the console.

Best Regards,
- Victor

Hi i just got the pro version and i can’t seem to make it work. I am using Astra Pro theme and WCPT Pro.

1. on a page: the filters show with the [fe_widget] but don’t seem to work Post Type to filter: products Where to filter? : pages / https://com-consulting.ro/filtru-produse/ Filter: product category

2. on Astra’s Shop Filter widget the filters don’t show at all, neither if added with the shortcode or widget; Post Type to filter: products Where to filter? : product categories Filter: product category

Any

Thank You

Could you provide the credentials to the wp-admin dashboard following this document so we can check it?

Best Regards,
- Victor

did it

We have checked the site, and most likely this is some conflict with other plugins or custom code, a lot of errors, even in the WP Admin widget area, so we would suggest turning off 50% of the plugin to check the workability of the plugin with updating the filter set. I the problem will still appear turn off another 50% of the plugin and test the workability. To find the plugin that is causing issues, or remove custom code and test workability if there is a custom code.

Best Regards,
- Victor

Hi, I have a website with an education portfolio and its corresponding categories. Is it possible to create a filter for a specific page that only shows the entries of the portfolio that correspond to a specific category and also filter by other taxonomy?

For example, the idea would be to have a page called Art and only show the entries in the Art category but also be able to use a search bar and filter by “books” “music”, etc.

Thanks in advance, best regards

Hi minimacompania,

Thank you for your interest in the Filter Everything plugin.

Our plugin doesn’t show any posts it is just filtering them. If you have a page that uses WP_Query and only shows posts from a certain category it will filter those posts.

If you have a page that shows only posts from the ART category, in which way you are planning to use a search bar and filter by “books” “music”, etc if the page shows only posts from the ART category?

You can have a couple of pages or you can create a filter by categories like here – https://demo.filtereverything.pro/posts/ with all of the possible categories, and use logic “AND” to show only products from a certain category and filter it and search and etc.

Best Regards,
- Victor

I understand that your plugin does not display the posts. So, for example, if I use Wp Bakery I should use the “Post Grid” module to display the posts of a given category, in the example “Art”.

Is this correct?

Yes, or you can use simple archive pages and make the link to the certain category that you need and place a filter set on that filter category. So you will have a menu that will send you to the different category pages like art and so on with the needed filtyer set on it.

Best Regards,
- Victor

Hello,

I’m trying to show the filter, but on the home page, but I’m seeing: “No one Filter Set is related to this page. You can configure it in the Filter Set -> “Where to filter?” field.”

I’m enable the filter by widget I also tried with shortcode, but I’m always seeing this and filters are not shown.

I’ve selected where to filter to pages -> all pages, I’ve tried on different pages, but without success. I’m using Wordpress 6.3 and Plugin versionVersion 1.7.15.

Thank you

Hi genov1824,

Thank you for choosing Filter Everything PRO.

In the “Where to filter” choose “common WordPress pages” + “Homepage”

Best Regards,
- Victor

Pre-Sale Question: I am currently using the Free version of the plugin and I am not sure if the pro version is needed to achieve what I want.

Use Case: Filter workouts by the equipment that the user has available.

ACF fields are selected to establish what equipment is needed for each workout. A workout being a WP post. So we have a radio field section setup to tick the correct equipment which is list filtered down.

Currently the ‘AND’ or ‘OR’ filter logic doesn’t seem to be doing what I need.

‘AND’ is closest to what I need, but I need it to strictly only show workouts that have the exact equipment ticked, not just the workouts that have the equipment ticked as well as other equipment.

Hope this makes sense.

Hi Callum,

We did multiple tests with different approaches and unfortunately, we couldn’t make the needed functionality out of the box.

It can be done only with custom code using a hook wpc_filtered_query_end or maybe even better use wpc_do_filter_request which, when a certain filter is selected, will turn on its logic or leave the one that is by default.

You can also use native WP hooks that define different parts of the SQL query. Such as ‘posts_where’, ‘posts_join’, etc.

Or you can create a custom field where instead of one option you write already a full set of equipment as one option, but it would look a bit messy in the filter widget.

But we will take it into consideration and perhaps with future updates we will implement logic like that.

Best Regards,
- Victor

Thanks for looking into this.

Is it possible for me to pay you to provide this code? Or is it something I can get access to by purchasing the premium plugin? This functionality is the make or break of being able to use it for my client so I would be happy to pay for the custom work?

Hi Callum,

We would gladly help, but unfortunately, we do not have spare time to write custom functionality.

But you can hire a developer from a platform like Upwork to write this functionality for you, implementing the “set/group” logic. To show certain items only when all of the terms are chosen.

Honestly, we are not even sure if there is any plugin that would have such functionality out of the box.

Best Regards,
- Victor

We have the filters showing for one of our pages which is derived from product attributes, but it won’t actually filter any products. It shows what attributes are available (those that aren’t are grayed out), but when selected the products aren’t being filtered. Link to page:

https://knittingboard.com/product-category/premium-patterns/

Hi knittingboard,

Please send the credentials to the wp-admin dashboard following this document so we can check it.

Best Regards,
- Victor

Sent! Thanks

Hi knittingboard,

The issue was hidden in the slug names, never use the same repeating slugs and the start of them for example, premium-patter in Woo cat and premium-pattern in URL prefix in filter, it will cause only errors and issues.

We have changed the premium pattern cat name to this – https://prnt.sc/LVhTWoSQatNU basically we add the number 8 at the beginning and the end of those two words. And we have placed the filter set “Premium Pattern” exactly on that product category to test it, and everything is working well. How you set it up and with what name is up to you, but please do not use the same slug/URL names.

Best Regards,
- Victor

Hi gtutgben,

Thank you for choosing Filter Everything PRO.

You can read about it here – https://filtereverything.pro/resources/brands-and-color-swatches/

Also, you should add all of the settings – https://prnt.sc/gYxUym0ZXtgN

Best Regards,
- Victor

I want the filter selection to be already “unfolded” as default view. Unfortunately I have not found a possibility in the settings. How can I implement this?

Current view when opening the page: https://share-your-photo.com/b5d7bb3ddb

Desired view: https://share-your-photo.com/58d5d6597f

Hi markusbln,

We can provide you with code that makes foldable filters open by default.

add_filter( 'wpc_folding_opened', 'my_folding_filters_opened_by_default' );
function my_folding_filters_opened_by_default( $filters_opened_by_default ) {
    $new_opened_by_default = [
        1041, // Filter ID
        300, // Filter ID
    ];
    return array_merge( $filters_opened_by_default, $new_opened_by_default );
}

But this code example changes the default filter status (when you open a page with them for the first time). If you open some or close the system will “remember” their status, and next time you will see the filter in the same status you saw it last time.

To make them always closed and require them to open whenever you open the page with filters needs some amount of code changes and unfortunately, we do not provide or debug custom codes under the CodeCanyon item support policy. You have to ask somebody experienced with PHP to help you with this.

We can only say that foldable filters use a cookie with the name ‘wpcContainersStatus’ to remember a filter status.

Best Regards,
- Victor

Hi, I’m having problems or I’m not understanding what’s wrong! I have a phytro with 2 types the second is Parent of the first. Marks and types. I use the WPML translator, in Portuguese original language, everything is fine. But when in the front-end I change the language the first filter Brand, does not appear!!! in PT https://prnt.sc/ol8FFIP-CPPU in EN https://prnt.sc/iM01RkOq_xJt

What am I doing wrong?

We have tried it on all available browsers including incognito mode. Maybe you have any restrictions by IP or Country or any other ones by who can enter on the login page? This is not the problem on our end.

https://prnt.sc/p16vClHz8wmp This is what the console shows a 403 error. 403 status code means that access to the requested resource is forbidden. The server understood the request, but will not fulfill it.

Best Regards,
- Victor

Security has been temporarily disabled to enter and verify. Wait for the solution.

Hi turisbike,

We have checked the site and here is the issue, since you are using “include” in one of the filters it will be saved to the language you are editing it in. Basically, if you edit in English it will save it for the English language and display it only for the English version.

The best way to fix the issues would be to create translations of filter sets by turning on this option in WPML settings – https://prnt.sc/TM5A7-seR_k4 to have the ability to do it. So basically you would need to create a filter set for each language and do the needed includes in each of them.

Best Regards,
- Victor

I’m trying to use Filter Everything to display a range of our ACF Number field, however the “Range” option is greyed out preventing me from selecting it.

I can select checkboxes, radio or select – but ideally need Range to be displayed.

Any tips?

Hi scott569,

Thank you for choosing Filter Everything PRO.

Please make sure that your ACF field is strictly numeric and does not contain any other data. You can check it in the database. Or for testing purposes create a new numeric custom field and apply it to any products/posts and test if it will work correctly, creating a new range slider by numeric custom field in the filter set.

Best Regards,
- Victor

Hello I have a filter by the square attribute, which can take values: 10-20, 21-27, 28-35, 106-130, etc. How can I sort them that way? Currently, with any sorting method, I get the following order: 10-20, 106-130, 21-27, 28-35.

Example: https://tramontana.com.ua/ru/kondicioner/

Is it correct to set the order directly in the code? Like this: update_term_meta(302, ‘order’, 1);

add_filter(‘wpc_terms_before_display’, ‘wpc_sort_terms_as_needed’, 10, 2); function wpc_sort_terms_as_needed($terms, $filter){ // pa_square – is desired taxonomy update_term_meta(302, ‘order’, 1); update_term_meta(307, ‘order’, 2); update_term_meta(308, ‘order’, 3); update_term_meta(309, ‘order’, 4); update_term_meta(310, ‘order’, 5); if ($filter[‘e_name’] === ‘pa_square’) { $newTerms = []; foreach ($terms as $k => $term) { $termOrder = get_term_meta($term->term_id, ‘order’, true); $term->menu_order = ($termOrder !== false) ? $termOrder : 0; $newTerms[$k] = $term; } }

// To sort in descending order
    // usort( $newTerms, \FilterEverything\Filter\EntityManager::compareDesc('menu_order') );
    // To sort in ascending order
    usort($newTerms, \FilterEverything\Filter\EntityManager::compareAsc('menu_order'));
}
return $newTerms;
return $terms;

Hi Igor_Shyshka,

Here is an example of the code:

add_filter('wpc_terms_before_display', 'wpc_sort_terms_as_needed', 10, 2);
function wpc_sort_terms_as_needed($terms, $filter){
    // pa_color - is desired taxonomy
    if ($filter['e_name'] === 'pa_color') {
        // Define the custom sorting order
        $customOrder = array(
            'red',
            'blue',
            'green',
        'purple'
        );

        // Create an associative array to store term objects
        $termMap = array();

        // Populate the term map
        foreach ($terms as $term) {
            $termMap[$term->slug] = $term;
        }

        // Sort the terms based on the custom order
        $sortedTerms = array();
        foreach ($customOrder as $slug) {
            if (isset($termMap[$slug])) {
                $sortedTerms[] = $termMap[$slug];
                unset($termMap[$slug]);
            }
        }

        // Add any remaining terms to the sorted array
        foreach ($termMap as $term) {
            $sortedTerms[] = $term;
        }

        return $sortedTerms;
    }

    return $terms;
}

and this is the results – https://prnt.sc/pYxJUGe6tXVM

Best Regards,
- Victor

Thank you very much for the answer. Your support is excellent as always.

Hi Stepasyuk, We are almost done setting up the filters. We are stuck with an issue :- Two of our filters have NA as values in them and they are selected by default. In chips, it shows as only NA which is confusing for the user. Can you help us add the filtername to it such as “Habitat: NA” or “Category: NA”?

I tried to find the answer for this in the comments and came across this function. I noticed that many users have requested for this. Can you kindly help?

function modify_chips_term_name($term_name, $term, $filter) { $modified_term_name = ‘Modified ’ . $term_name; return $modified_term_name; } add_filter(‘wpc_chips_term_name’, ‘modify_chips_term_name’, 10, 3);

Thanks so much Victor. It gave me a great start into hooks. I have modified the above code achieve the output I require.

function custom_chips_term_name($term_name, $term, $filter) { } add_filter(‘wpc_chips_term_name’, ‘custom_chips_term_name’, 10, 3);

if ($term_name === NA) { // Check the Term name        
    // Get the filter's slug
    $filter_slug = $filter[label];
}
else{
    return $term_name;
}
// Concatenate the filter's slug with the term name
$modified_term_name = $filter_slug . '-' .  $term_name;
return $modified_term_name;

Sorry, I’m not sure why the above function is not formatted properly.

Hi amith458,

Glad to hear that you have managed to modify it to your requirements.

Best Regards,
- Victor

by
by
by
by
by
by

Tell us what you think!

We'd like to ask you a few questions to help improve CodeCanyon.

Sure, take me to the survey