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

PRODUCTS AREN'T BEING SHOWN IN FILTER

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.

Filtering by size, eventhoug the product has the size avaliable, isn't being shown

the options"in stock" that seek at variations is activated.

 

see these pictures ->>  https://ibb.co/VMpjwx6
https://ibb.co/FmR5t5r

Hello Vyctor

Please  drop me  exact  link to the issue

and  wp-admin access - https://share.pluginus.net/image/i20210618130558.png ->https://share.pluginus.net/image/i20210618130637.png

 

https://lojav2a.com.br/categoria-produto/masculino/calcado/slip-on/?swoof=1&stock=instock&pa_tamanho=tamanho_40&really_curr_tax=197-product_cat ->>> link with filter by size"40" and category"Slip On"

 

if you see these products ->> https://lojav2a.com.br/produto/slip-on-np-eco-camdaik/
https://lojav2a.com.br/produto/slip-on-np-confort-tric/
https://lojav2a.com.br/produto/slip-on-jeans-camdaik/

these products are from category slip on and have size 40 available but aren't shown as result.

Hello

each of these products has a variant: Size 40 and  out of stock - https://c2n.me/4duBruQ.png https://share.pluginus.net/image/i20210929130100.png https://share.pluginus.net/image/i20210929130124.png

The filter sees that the product is out of stock and excludes the parent product. If you add a search by color to a query, the products will appear

But the variant product in color black isn't out of stock.

If i keep this way, the costumer won't see the product eventhough it's available

Is there a way to make filter seek in color variation too?

whats i don't understand is why this product isn't shown since size 40 is in stock for color black

Its intuitive for costumers to show all options. don't you think?

Hello

Please  try  this  link - https://lojav2a.com.br/categoria-produto/masculino/calcado/slip-on/?swoof=1&stock=instock&pa_tamanho=tamanho_40&pa_cor=cor_preto&really_curr_tax=197-product_cat

I will describe the search logic in a little more detail:

There is a request for variations that have the specified attributes and are not in stock.  An example:  Size 42 + out of stock

And if such a variant exists - the filter excludes the parent product from the main search query

the problem is that each variant can have from one to hundreds of attributes. And creating a request from all possible combinations is extremely unreasonable.

thanks for your care trying to explain and i got it.

But i'd really appreciate woof to look all variations. Is there a way to do it?

Because if the costumer look for size 40, this product won't be found -->  https://lojav2a.com.br/produto/slip-on-np-eco-camdaik/
https://lojav2a.com.br/produto/slip-on-np-confort-tric/

but this product is in stock for number 40

Hello

but this product is in stock for number 40 - Yes! Same way the  product  is  out of stock for  number  40 - https://share.pluginus.net/image/i20211001132217.png

I understand you. But we are technically dependent on the database structure

Is there a way to do it? - I can pass it to the developer. And in the best case (perfect solution) one query is added to the database for each product.  And this will double the load on the server.

I can pass it to the developer. - Try it please. Let's see how it works. We don't have many products variations and we can improve our host service if need.

Hello

I passed it to the developer

I will write to you as soon as we get the result

Hello

Try in  file  - wp-content\plugins\woocommerce-products-filter\ext\by_instock\index.php

add this  code  - https://share.pluginus.net/image/i20211005193423.png

foreach($args['meta_query'] as $key=>$data){
if(isset($data['key']) AND $data['key'] == '_stock_status'){
$args['meta_query'][$key]['value'] = 'instock';
}
}
$query_excl = new WP_Query($args);
if ($query_excl->have_posts()) {
foreach ($query_excl->posts as $p) {
if(isset($products[$p->post_parent])){
unset($products[$p->post_parent]);
}
}
}

And  do a test

Hey there! The image  https://share.pluginus.net/image/i20211005193423.png can't load

I probably put the code at the wrong place. nothing happened

Hello

add  this  code in line - 187

and  drop  me a screenshot  with  this  code

Screenshot ->>> https://ibb.co/q5MnF8g

after puting code, filter didin't change

Hello

Yes, you inserted the code in the wrong place

Insert the code a little higher before the line:

$product_ids = implode(',', $products);

It worked!! You was very helpfull. thankyou bro

Hello

Ok! Great

Stay tuned for the plugin update, maybe we will connect this code using a hook

Welcome;)