
Federicoknudtsen@gmail.com(@federicoknudtsen-gmail-com)
4 Posts
Customers
Quote from Federicoknudtsen@gmail.com on February 28, 2024, 18:21
Hi! I have some products with some color attributes, but there are no active variations for them. In other words, they are out of stock.
I want to know if there is any way in which i can hide those products that doesn't have an active variation while filtering that attribute.
PD: I found this code, but i pasted it in some places an didn't work:
add_filter('woof_get_request_data', 'my_woof_get_request_data');
function my_woof_get_request_data($data){
$data['stock']='instock';
return $data;
}
Where do i have to paste it?
Hi! I have some products with some color attributes, but there are no active variations for them. In other words, they are out of stock.
I want to know if there is any way in which i can hide those products that doesn't have an active variation while filtering that attribute.
PD: I found this code, but i pasted it in some places an didn't work:
add_filter('woof_get_request_data', 'my_woof_get_request_data');
function my_woof_get_request_data($data){
$data['stock']='instock';
return $data;
}
Where do i have to paste it?

Pablo Borysenco(@pavlo_borysenco)
34,196 Posts
Quote from Pablo Borysenco on February 29, 2024, 11:50
Hello
In this case, the product or all variations must have the status out of stock
this code should be inserted into functions.php
Hello
In this case, the product or all variations must have the status out of stock
this code should be inserted into functions.php