PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Filters don't work with predefinition

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hello,

We have a project that used the pre-filter products on a page that is not the store page.

For this we use woot (for example [woot id=2 filter_provider='woof' predefinition='{"sku":"14202,14172"}']). This work fine but the project can give many skus.

So we have place filter on the page, a widget bar on the left and some shortcode filter on the top. When whe try to filter with the widget bar, nothing work (for example"Réseau opérateur" = covage)
Otherwise, if we write covage on the shorcode filter"Titre", the result is ok but it's the only filter that is working.

You can view the problem with the link in the private data, the button"Commander" on the bottom will redirect you to the page with pre-filter products.

Hello

I  created a test   -  https://your_site.cloud/test-woof-woot/

Everything seems to be working correctly.

Try to insert a shortcode without your customization

Hello,

I know it works without the predefinition param, i test it before create this topic but we need the filter working using the predefinition param

 i test it before create this topic but we need the filter working using the predefinition param - it works.  Try using taxonomies instead of SKUs - https://c2n.me/4cPETKY.png

We can't use the taxonomies, we get skus from an external source.

Your plugin gives the possibility to use predefinition, I don't see why we should use another solution to make the set work. We need to filter using features provided by your extension, it's normal to wait for everything to work.

We therefore wait for the filters to work with predefinition, two functions offered by WOOT and WOOF.

Hello

I passed this to the developers. I write to you as soon as we get the solution

Hello

Try  to  use  this  hook  - https://products-filter.com/manipulate-search-data-options/  - in your  case:

$request['woof_sku'] = '14202,14172'

This solution is better because the filter will be adapted to the current SKU

alternative solution:

in  file - \wp-content\plugins\woot-products-tables\index.php - change  code  - https://share.pluginus.net/image/i20210729170206.png

if(isset($args['post__in']) AND count($args['post__in'])) {
$post__in = array_intersect($ids,$args['post__in']);
if(!count($post__in)){
$post__in = array(-1);
}
$args['post__in'] = $post__in;
} else {
$args['post__in'] = $ids;
}

 

Hello,

I went with the first option which works as I might expect.

Thanks.

Hello

Welcome;)

Finally, there is still a problem.

When we click on reset, the sku filter does contain the list of sku but the filter is not applied.

Hello

unfortunately I didn’t understand you

I checked, after clicking on reset the table shows correct products (according to SKU)

Hello,

In reality, the pre-filter is no longer working and I can't find out why. For the case that I linked in the private data, we should have 132 products when entering the page but we actually have all the products.

You have to go to the list of skus and hit the enter key for the filter to apply.

And the problem is the same when we click on the delete button.

I think there is a configuration problem, I made several changes on Friday but I searched this morning and I cannot restore the expected operation.

Hello

Ok!  Try  in  file  wp-content\plugins\woot-products-tables\profiles\woocommerce\compatibility.php  - delete  this  code - https://share.pluginus.net/image/i20210803113529.png and  do a  test

Hello,

The modification is in place but it doesn't change anything.

Hello

https://share.pluginus.net/image/i20210803175028.png - where did you add this code

I didn't find this code in functions.php

Hello,

It was in a plugin.
I moved it to functions.php to make it easier.

Hello

Unfortunately, I do not know for what reason it stopped working for you.

Please  try  also  add  to  shortcode  - https://share.pluginus.net/image/i20210804192629.png

Hello,

It now works by putting"predefinition" again and leaving the filter on woof. The only remaining problem is the calculation of count of products by category at the loading of the page and at the reset but we decided to hide them.

On the other hand, it did'nt work on my local development version. After analysis, I saw that you had added the modification on index.php proposed on july 29. By doing it on my local version as well, it also works. Without this modification, I had the problem submitted initially. Will this change be present in the next update?

Hello

The only remaining problem is the calculation of count of products by category - And  use - https://share.pluginus.net/image/i20210805142939.png

Will this change be present in the next update? - Yes!