8972 comments found.
Collapse button works for all iPads in portrait mode – SOLUTION for me is: /all tablets portrait/ @media screen and (hover: none) and (orientation: portrait) { body.wpc_show_open_close_button .wpc-filters-widget-content:not(.wpc-opened) { display:none; } .wpc_show_bottom_widget .wpc-filters-open-button-container, .wpc_show_bottom_widget .wpc-filters-widget-controls-container, .wpc_show_bottom_widget .wpc-filters-widget-top-container, .wpc_show_open_close_button .wpc-filters-open-button-container { display: block; } }
I don’t know if it’s 100% correct, but for me works OK… Because some iPads on retina didnt collapse in portrait mode even after plugin update…
Hello anoagency
Thank you for your recommendation.
If somebody asks me to force filters to switch in mobile mode for some specific devices I recommend them to change mobile breakpoint value for the plugin. It can be achieved with this code:
add_filter( 'wpc_mobile_width', 'my_custom_wpc_mobile_width' );
function my_custom_wpc_mobile_width( $width )
{
$width = 1180; // new desired breakpoint in px. If you want to use it only in portrait iPad mode please change to 820
return $width;
}
If your code works for you, you can leave it as is. But also you can try to use my code example, which is more reliable.
i have a store with eight main categories. on the category page, only the subproduct categories should be available as filters.
currently i have 8 filters and include the matching categories manually and display them on the respective category page.
can this be simplified so that only the subcategories are automatically displayed, depending on the category where you are?
Hello diekonkr
I recommend you to use Product categories widget or Menu item in addition to the Filters widget with filter by Categories. In this case when visitor selects any category it will be directed to the page with products from this category only and filter by Category will not show any extra categories (in case if you set “Empty filters – Always hide”)
But if such structure is not good for you, you also can modify Categories list in the filter by using hook ‘wpc_terms_before_display’ – https://filtereverything.pro/resources/hooks/#terms-before-display-hook
It allows you to specify what exactly terms will be shown in the filter and you can add condition that if parent category is selected, then to remove all extra categories and show children only.
where can i see my filter set id? can’t find them for the shortcode
Just open the Filter Set in edit mode and look please on its URL.
You will see there post=xxxx that xxxx is Filter Set ID. Please, see example – https://prnt.sc/brzRGU8bclh4
I was the one who requested a refund for the plug-in earlier, but after checking again, it seems that your plug-in is sufficient. Therefore, we will cancel the refund request.
Thank you for developing such a great plugin. Have a nice day!
Hello falling0
Sure, no problems. Thank you for your notification and I wish you to enjoy with the plugin capabilities.
Thank you for developing such a great plugin. Unfortunately, this plugin doesn’t exactly match the features I’m looking for.
I’m sorry, but I think it’s better to find another solution. Please guide me on what process to go through to get a refund.
thanks.
Hello falling0
I’m sorry that you were not satisfied with the plugin. Please, create a refund request via appropriate form in your account and it will be processed as soon as possible.
Thank you. Regards.
Good afternoon! The price filter on the home page doesn’t work. The other filters work fine on the main page, the filter “_sale_price” also works on the main page. The filter by price works on the store page, but not on the main page of the site. Can you tell me what it may be? All the settings are correct.
Tried to make a copy of the home page and installed the same filter-set there. The price filter and other filters on the copy of the home page work fine.
https://dev.flowry.ru/ login:flory / password:floryHello mitinegor
Unfortunately I have no access to sites in *.ru domain zone due to russian government restrictions and I can not provide support on sites there.
Hi,
Yes, my support has expired (buying more licenses soon when my project goes into production) but I think I have identified a bug in the plugin. When the base url (the part before the filter parts are added) ends with a numeric string, that numeric string is removed from the url in the filter hrefs. This makes the filters not work.
So let’s say the base url is ‘https://domain.com/posttype/taxonomy/1234/' then the ’/1234’ part gets removed, making the filter href ‘https://domain.com/posttype/taxonomy/filter-value/' when it should be ‘https://domain.com/posttype/taxonomy/1234/filter-value/'. When the filter is clicked the AJAX call returns a 404 because the url doesn’t exist.
I’ve traced it down to /src/UrlManager.php line 190. There you remove page and comment pagination from the url on lines 188 and 189, and have a broader regex on line 190. When I comment that line, the issue is fixed.
Could you please tell me if you would consider fixing this in an update?
Regards, Bas
Hi Bas.
Thank you for your report.
For the moment I have no plans to change it because for example Elementor pagination has the same URL scheme with numbers in the end. Please, see example – https://demo.filtereverything.pro/elementor/3/
I would like to use pattern {/page/N} to remove only pagination links but it will not be compatible with Elementor. That’s why I recommend you do not use numeric slugs for your posts or just to hardcode Filter Everything PRO on the site that uses numeric slugs if there is no way to avoid them.
Thank you. Regards.
After installing new update to wordpress, I get the following error ‘Invalid licence key’.
Hello moshef3
It’s very strange, but are you sure that this message was produced by the Filter Everything PRO plugin? Because my plugin shows such error message only as answer when you try to register your license key. Did you try to register your license key again on Filters -> Settings -> License tab?
add_filter( 'wpc_filter_post_meta_term_name', 'wpc_custom_term_name', 10, 2 );
function wpc_custom_term_name( $term_name, $entity_name ){
// $e_name is meta key in our case
// $term_name is term value stored in meta field in our case
if( $entity_name === '_airconditioner' ){
$term_name = 'מזגן';
}
return $term_name;
}
I solved the problem. Just add ?reset_filters_cache=true to the URL. Thank you for the excellent plugin!
Is there any hook to change Filter Title by Meta Key? For example, I created a filter set with different filters, each with its own Filter Title. And for each version of the site, I want to display my own Filter Title. Thank you!
Hello maxim-belenkiy
I’m glad that your first problem were solved by yourself. About filter title – you can change it via hook ‘wpc_filter_label’. Here is example of how this hook works:$filter_label = apply_filters( 'wpc_filter_label', $filter['label'] );
Also if you use WPML or Polylang you can create translated Filter Sets. Please, see here how to do that – https://filtereverything.pro/resources/with-wpml-polylang/
Hello! Bought your plugin. We have 2 problems: 1. We cannot activate the license, writes an error 2. Filter problem with h1 headers. If you go to a category and do not use a filter, then 1 product is taken from the list and substituted
additionally, an error came in the webmaster.
Неправильный адрес страницы (5 ошибок)
стр.
поз.
1
2
Fatal error: Uncaught Error: Class ‘FilterEverything\Filter\Container’ not found in /var/www/u1846802/data/www/metal-zabor.ru/wp-content/plugins/filter-everything-pro/src/Swatches.php:335
3
Stack trace:
4
#0 /var/www/u1846802/data/www/metal-zabor.ru/wp-content/plugins/filter-everything-pro/src/wpc-helpers.php(51): include_once()
5
#1 /var/www/u1846802/data/www/metal-zabor.ru/wp-content/plugins/filter-everything-pro/filter-everything.php(92): flrt_include(‘src/Swatches.ph…’)
Hello seigemsk
Thank you for using Filter Everything PRO.
Please, note that License key and CodeCanyon purchase code are different things. To set License key, please go to Filters -> Settings -> License, click on the “Get your License Key” https://prnt.sc/-ehm9df3H_XT and you will be redirected to the new page. Log in there with your Envato credentials and you will see your License key for the Filter Everything PRO plugin.
Unfortunately I have no access to sites in *.ru domain zone due to restrictions of russian government so I physically can’t provide support for sites from there. I can only say that for H1 archive title Filter Everything uses next hooks:'woocommerce_page_title' 'get_the_archive_title' 'avada_page_title_bar_contents' 'post_type_archive_title' 'elementor/utils/get_the_archive_title'And you can try to find the problem somewhere in these hooks.
Thanks for the answer! The problem with activation remains, we did it according to the manual as you wrote. An error crashes https://prnt.sc/oCaGyXqpwzok and the plugin does not pass activation
and about the filter in the category. A question from our programmer : https://ibb.co/fHPtXpW how do I know that a filter is selected? Headers are output by this code when just the category needs “111111” when there is a filter then “2222222”
The filter in the category has been sorted out. Please help me with the error when entering the license number
Hello seigemsk
Unfortunately I can’t help you with activation site in *.ru domain zone. If there is no connection between this site and license server I can’t do nothing with this. And the reason of this problem are restrictions were made by kremlin.
You may create refund request and to get your money for the plugin back. It’s all that I can offer you in this case.
Hi, I installed ACF and filtereverything.pro to filter for added fields. I was able to create the filter with my ACF Fields. But there are 2 things I don’t get through.
1) During the first tests I selected wrong FilterBy options. So I deleted the old and created new ones. Now I get the info that the URL Prefix is already taken. Can I clean that mess up?
2) I added true/false fields in ACF. Now I want to overwrite the default 0/1 output by some text. I already stepped into the hooks, but these seem to not work in all cases. I added each one after the other and it seems only one is really working:
function wpc_modify_taxonomy_term_name($term_name, $e_name)
{
$term_name="ok".$e_name;
if (in_array($e_name, array('wandern_kinderwagentauglich'))) {
$term_name = "test";
}
return $term_name;
}
add_filter('wpc_filter_post_meta_term_name', 'wpc_modify_taxonomy_term_name', 20, 2 );
add_filter('wpc_filter_post_meta_exists_term_name', 'wpc_modify_taxonomy_term_name', 20, 2 );
add_filter('wpc_filter_post_meta_num_term_name', 'wpc_modify_taxonomy_term_name', 20, 2 );
add_filter('wpc_filter_taxonomy_term_name', 'wpc_modify_taxonomy_term_name', 20, 2 );
add_filter('wpc_filter_author_term_name', 'wpc_modify_taxonomy_term_name', 20, 2 );
...
If you have a look on https://koenigskinder-ausflugsziele.com/wandern-mit-kindern/ziele-und-touren you can see that this overwrite is only working for the hook “wpc_filter_post_meta_exists_term_name”.What am I getting wrong here?
Thanks in advance!
To Point 2: It seems I have to save the ACF Group after I change the code for the hook. Then the code is executed…
Hi ys-thorsten
Thank you for purchasing the plugin. I’m glad to meet here person who are so experienced in coding 
1. To avoid predefined URL prefix you have to delete this filter in all existing Filter Sets. If it was the only one Filter Set, where you created such filter, please delete filter and update your Filter Set. After that you will not get predefined prefix.
2. If you created Custom Field Exists filter based on your true/false ACF field the only ‘wpc_filter_post_meta_exists_term_name’ will affect on this filter. Because every term name hook works for specific filter type only. So such behavior is expected.
Hi,
Congrats for your super-plugin!
Is there any possibility to select some filtersets in widgets to keep them uncollapsed?
By default the filters in shop page all collapsed with pop-up setting in mobile view.
I have another filter-set set in homepage with labels and submit button. Is there any way or extra shortcode arguments to keep it un-collapsed and not be replaced by filter-button in mobile view?
Thanks in advance Khris
Hi Khris
Thank you for using Filter Everything PRO.
In general it is possible by CSS adjustments for the Filters widget that should not be collapsed on mobile devices. You can access to the CSS properties of such widget via unique class it contains. For example ”.wpc-filter-set-2460” where 2460 is Filter Set ID.
And to make Filters button to open only desired Filters widget on mobile, you can disable automatically inserted Filters button in Filters -> Settings -> Experimental -> Hide opening widget buttons
And after that to insert Filters button via shortcode https://filtereverything.pro/resources/shortcodes/#open-button and specify Filter Set ID that should be opened.
Hi there, we just bought your plugin and want to use it with avada. Well, in general it is working finde, but if we filter on a category page build with avada, the variable products selection does not work anymore. klick here: https://dev.beevisible.de/shop/alle-produkte/ As you can see, the barbaresco 2020 is available in 3 formats but only 2 are in stock. Now use your filter for 2020 and yes, it is filtering correct but the stock check, the “choose variation” buttons and the add to cart are broken. Hope you can help!
Besides that issue, the “Filter by Price” is also changing its look after user one of the filters.
Hi generics
Thank you for using Filter Everything PRO.
I’m not sure, but I guess that these problems were on the page, when you used AJAX for filtering. If yes, it means you have classic problem described here – https://filtereverything.pro/resources/ajax-related-problems/
And you have to re-init all JS events on your page after content was loaded by AJAX or consider to use filtering with regular page reload after selection every filter.
Unfortunately the common way to make all JS events compatible with dynamically loaded content does not exists and that’s why I can’t add it to the plugin. And in every such case it should be solved individually for a site.
Hi. I bought a website with a Locked plugin status. I bought a license, but I can’t activate it – error “Invalid site URL was sent”.
I deleted the plugin, but it didn’t help. Can you deactivate the domain name on the license server side? Thanks.
Hello pavelf7
Thank you for using Filter Everything PRO.
Please, send me your domain name via PM and I will check it.
Hi Filter Everything Pro team – We are using FEP on our Woocommerce store and have identified a conflict with the Wholesale Suite plugin (https://wordpress.org/plugins/woocommerce-wholesale-prices/).
Through a process of turning plugins on and off we noticed that once Wholesale Suite is active the filters no longer work for users who are not logged in as administrators (they still work for logged in administrators).
You can see some basic filters in action here: https://elbilsvaruhuset.se/produktkategori/laddkablar/
Are you aware of this conflict or can you think of a likely cause/remedy?
Thanks in advance for your support.
Iain
Hi yunral
Thank you for using Filter Everythibg PRO and for your report.
I didn’t hear about such conflict before, but I can say that if filtering works different for logged in and logged out users in 99% of cases it means that you have different WP_Queries on the page for logged in and logged out users.
Filter Everythibg “catches” targeted WP_Query when you configure your Filter Set and it filters only this WP_Query. If logged out users see another WP_Query you have to make some manipulations “to catch” this second WP_Query. And also you have to create two Filter Sets, direct them to the same page(s) and in dependently from logged in/out status to show first or second Filters widget.
In other words it requires additional operations to make it work for both type of pages. And for the moment it is impossible to allow Filter Everything PRO to work with logged in/logged out WP_Queries out of the box.
Thank you for your reply. None of our retail customers are logged in so we may only have to “catch” one type of WP_Query to make the filters. Can you please advise which code we need to manipulate to make this happen?
Hello yunral
I think you can try to do next trick: 1. To display your WP_Query that should be used in logged-out mode when you are logged in. In this case you will be able to “catch” it in Filter Set.
2. After you select it in the “And what to filter?” field and save your Filter Set you can try to display the WP_Query for logged-out users and try to filter it. If it works you can use it until you change your Filter Set.
After that you can configure your second Filter Set for this page, that is displayed in both – logged in and logged out modes. When you use two such Filter Sets it is better to insert them both via shortcode [fe_widget] and specify Filter Set ID for every such Filter Set. And probably to display them separately in dependancy from logged in/logged out status.
Hello again,
I was wondering if you could help me with a few issues please
1. I noticed the breakpoint at which the plugin exports the filters on mobile “directly” instead of using the the open filters button is not ideal. Fore example on mobile if i use the phone in landscape the button disappears and the filters appear directly. Is there a way I can for mobile button to start from a higher width ?
2. I need to add rel=”nofollow” to the filter links. I know they will not be indexed but unfortunately if there are many filter links the crawler will spend its crawl budget by following all the filter links. Adding nofollow to the filters links would fix the issue
Thank you
Hello shumo
1. You can change breakpoint, when Filters switch to mobile view. Please, add the following code in the functions.php file of your active theme and edit it with desired breakpoint. By default brekpoint value is 768 (px)
add_filter( 'wpc_mobile_width', 'my_custom_wpc_mobile_width' );
function my_custom_wpc_mobile_width( $width )
{
$width = 1180; // new desired breakpoint in px.
return $width;
}
2. You can achieve this by using Filter term HTML hooks. Please, see details here – https://filtereverything.pro/resources/hooks/#term-html-hooks
Also you can use Templates Overriding feature, but the way via hooks is better and easier.
Only dropdown has a searchbar.Can add searchbar to others or let dropdown can mutil seletct
Hello hljhljhlj
Thank you for purchasing the plugin.
You can add searchbar to any filter layout except range filters. Just open filter’s “More options” section and enable appropriate checkbox – https://prnt.sc/cuvqWIEn9a7e
Hello,
Thanks for the Filter Everything plugin. Unfortunately I can’t get along with it or thought that it would have been useful for my case. I wanted to place two dropdown boxes next to each other for a portfolio view. Unfortunately that didn’t work.
Now I found another solution.
Would it be possible for them to give us the money back? So could make a return (refund)?
Thanks very much
Hello Nikkor
I’m sorry that you weren’t satisfied with the plugin. In fact Filter Everything PRO works with Portfolio items and allows you to create two or more dropdowns to filter items.
But I see your refund request and it will be processed soon. Thank you. Regards.
Hello! We are using you plugin and have some issues:
1) License key can’t be activated. We get message “Invalid license key. Please enter correct license key.”
2) Pricing filtering uses variable products price too. Can it be disabled or ignored?
Hello ypromo
Thank you for using the plugin.
And I’m sorry for the late response. I suddenly ended up in the hospital and I’m still here and I only have my smartphone with me and I do not have enough powers to process all requests. I will have my laptop in a day or two and will try to answer to all support questions.
About the License key it’s popular question – please, note that License key and CodeCanyon purchase code are different things. To set License key, please go to Filters -> Settings -> License, click on the “Get your License Key” https://prnt.sc/-ehm9df3H_XT and you will be redirected to the new page. Log in there with your Envato credentials and you will see your License key for the Filter Everything PRO plugin.
About price filter – please try to disable checkbox “Use for Variations” If this will not help you please, try to change URL prefix for the filter from “price” to something another “fprice”, “xprice”. Because “min_price” and “max_price” are default WooCommerce filter variable names and WooCommerce takes into account variation prices.
Thank you. Regards.
Hello, We checked your suggestions according to the price filtering, but they are not working. Checkbox “Use for Variations” is disabled and URL prefix changing doesn’t fix that. Maybe you have another solution?
Thank you!
Hello ypromo
Plase, provide me with link to the page with example where price filter includes variation prices also.
Also it would be great if you provide me with credentials to your /wp-admin in accordance with this document I will check it myself.
Thank you.
Unfortunately, we work locally. Here are screenshots of this issue:
Added a variable product https://scrshot.promo-theme.com/b1mzlWZx
price filter settings https://scrshot.promo-theme.com/8LwBd58w
In the price filter it shows the variable product https://scrshot.promo-theme.com/XCKTDkwM
And we see that it adds it to the new_array https://scrshot.promo-theme.com/ThR5TZcN
Please fix this issue ASAP!
Hello ypromo
In general the problem may be in the GET-variable that Price filter uses. And GET-variable depends from the filter prefix you specified. Because if the variable is max_price (or maybe even max__price) WooCommerce automatically adds its own SQL sub-query which takes into account variations price.
If you use another GET-variable WooCommerce does not add this sub-query. Please, open the Filters -> Settings -> URL prefixes and change “product_price” to “xprice” and save it. After try to filter. If this will not help you, please install Query Monitor, filter products by price and find filtered SQL query. It contains phrase ”/* Current SQL Query is filtered by Filter Everything plugin */” and provide me with this query here in comments.
Thank you. Regards.
SELECT wp_posts.ID,wp_posts.post_content,wp_posts.post_excerpt,wp_posts.post_name
FROM wp_posts
WHERE 1=1
AND ( wp_posts.post_name IN ( '1' )
OR wp_posts.ID IN (
SELECT wp_posts.ID
FROM wp_posts
LEFT JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE 1=1
AND wp_postmeta.meta_key = 'wpc_filter_set_apply_button_post_name'
AND wp_postmeta.meta_value IN ( '1' ) ) )
AND wp_posts.post_type = 'filter-set'
AND wp_posts.post_excerpt = 'product'
AND ( (wp_posts.post_status = 'publish') )
ORDER BY wp_posts.menu_order DESC, wp_posts.ID ASC
SELECT option_value
FROM wp_options
WHERE option_name = '_transient_timeout_wpc_terms_post_meta_num__price_product_product_variation'
LIMIT 1
https://scrshot.promo-theme.com/vwKMk4Lm
Also, we have another issue:
if in the woocommerce settings you select the display of products, for example, by the number of sales https://scrshot.promo-theme.com/rTNtk6G2 , then the “Filter Everything – Sorting” widget (sorting is made on its basis) stops sorting by rating, by sales, etc.
Hello ypromo
Thank you for the SQL-query you provided. But it is not the filtered query. The filtered query should contain /* Current SQL Query is filtered by Filter Everything plugin */ Please, provide me with correct query.
For another issue, please create new comments thread to avoid confusion.
Thank you. Regards.
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
LEFT JOIN wp_wc_product_meta_lookup wc_product_meta_lookup
ON wp_posts.ID = wc_product_meta_lookup.product_id
WHERE 1=1
AND ( wp_posts.ID NOT IN (
SELECT object_id
FROM wp_term_relationships
WHERE term_taxonomy_id IN (7) ) )
AND ( ( wp_postmeta.meta_key = '_price'
AND CAST(wp_postmeta.meta_value AS SIGNED) <= '292' ) )
AND ((wp_posts.post_type = 'product'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private')))
AND NOT (292.000000<wc_product_meta_lookup.min_price
OR 0.000000>wc_product_meta_lookup.max_price )
GROUP BY wp_posts.ID
ORDER BY wp_posts.menu_order ASC, wp_posts.post_title ASC
LIMIT 0, 16 /* Current SQL Query is filtered by Filter Everything plugin */
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID
FROM wp_posts
INNER JOIN wp_postmeta
ON ( wp_posts.ID = wp_postmeta.post_id )
WHERE 1=1
AND wp_posts.ID IN (47,44,41,38)
AND ( ( wp_postmeta.meta_key = '_price'
AND CAST(wp_postmeta.meta_value AS SIGNED) <= '292' ) )
AND ((wp_posts.post_type = 'product'
AND (wp_posts.post_status = 'publish'
OR wp_posts.post_status = 'private')))
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 4 /* Current SQL Query is filtered by Filter Everything plugin */
Hello ypromo
Thank you for the SQL-queries you provided.
In general first SQL-query contains string from WooCommerce pluginAND NOT (292.000000<wc_product_meta_lookup.min_price OR 0.000000>wc_product_meta_lookup.max_price )
And this is the reason, why it affects also variable products. As we told you before the reason may be in “prefix for URL” that contains word “price”. Because for WooCommerce this word is trigget to add such SQL-subquery. We recommend you try to use something another that does not contain even word “price”.
Also you provided two SQL-queries and I’m not sure what exactly filters your target products grid. In general it means that you have at least two Filter Sets directed to the page, where you got these SQL-queires. Maybe you have to remove one of them.
Hello!
We changed the prefix to “fil” for testing and the variable price is used again. https://scrshot.promo-theme.com/93BgZB4D
Please provide docs of how to tune it because at the moment it’s not working from the box.
Hello ypromo
In this case I can only say that for some reason your SQL-query gets this additional sub-query that selects variable products also.AND NOT (292.000000<wc_product_meta_lookup.min_price OR 0.000000>wc_product_meta_lookup.max_price )
By default if your price filter variable name are not ‘min_price’ and ‘max_price’ WooCommerce shouldn’t to add this sub-query. But if this sub-query appears on your site it means that something other add it: another plugin or custom code. And unfortunately this is not supported case because I can say for 100% that Filter Everything PRO does not add it.
I would like to buy this product but I need to know first if you can sort CPT posts by ACF field date. So I do not want to use the published date. I want to use the date that the user enters in an ACF Date Field and have the plugin sort the posts based on that date and not the published date. (I need to sort in ascending or descending date order, using ACF Field Date) Can your plugin do that? I just tried Jet Smart Filters and it cannot do that. Can yours?
Hello coolhairstyle
Thank you for your interest in Filter Everything PRO.
I think yes, you will be able to sort your CPT items by your custom field, where you stored Date. For this you have to use Sorting widget included in the plugin and create new sorting option by Custom Field. 80% of chances that it will work out of the box. But if not, I will provide you with hook that allows to do that via small custom coding. It depends from the format of Date stored in DB.
Hello there is a Bug in Js with this function : wpcReloadSorting() When you set filters and no results find in the page and then try to clear chips there is an error and doesnt work. Because in wpcReloadSorting function you try to replace ”.wpc-sorting-form” elem in the current page. But the problem is that the elem ”.wpc-sorting-form” doesn’t exists if no results founds. Please can you fix this issue by just checking if the elem ”.wpc-sorting-form” exists before replacing it. Thank you
Hello youssefe74
Thank you for your bugreport.
Please, provide me with link to the page, where you got this error. Because in fact inside thewpcReloadSorting() function I check if .wpc-sorting-form exists on the page. Please, see copy of the code below:
function wpcReloadSorting( $response ){
let wpcSortingForms = $response.find('.wpc-sorting-form');
if ( wpcSortingForms.length < 1 ) {
return;
}
let originalSortingForms = $(".wpc-sorting-form");
if( wpcSortingForms.length > 0 ){
wpcSortingForms.each( function ( index, elem ){
originalSortingForms[index].replaceWith(elem);
});
}
}
hello thanks for your response
Unfortunately I have already solved the problem on my site so I cannot reproduce the problem for you.
Originally when no product is found the .wpc-sorting-form does not exist, so I had to add it in my theme to avoid this bug.
Yes you check the existence of this element but in the response and not in the current page. And so if in the current page the element does not exist and in the response it does exist then the error occurs because you are trying to replace an element that currently does not exist. Here is the problem. You must also check that the element exits in the current page before doing a “replacewith”.
the condition need to be : if (wpcSortingForms.length > 0 && originalSortingForms.length > 0)
or something like that
Ok, thank you youssefe74 for your hint. I will check this moment.