This topic has 13 replies, 3 voices, and was last updated 2 years, 5 months ago ago by Rose Tyler
Hi,
I have tried in every way to hide out-of-stock products by default. It has not been possible and I have not found a way either.
It happens to me with the variable products that appear in the shop but not with the parents, only in the variations loop.
How can I hide them? With the filter ?stock_status=in_stock if it works.
Can you help me?
Thank you
Hello,
Thanks for contacting us.
Unfortunately, WooCommerce does not have option to hide out of stock variations only. Please submit a request about adding a new option for our theme here – https://www.8theme.com/taskboard/
Regards
Hi Rose,
not only hide variations, I want to hide all non-stock products. Currently it hides me the simple products and the parents of the variations.
thanks
Hello,
1) Could you, please, provide us with an example of the variable product that has out-of-stock variations?
2) As I can see you enabled the option to show variations of the variable product as simple products on the shop page. And you want to hide these out-of-stock simple variations from the shop page if you filter by the stock status, right?
Regards
Yes, the problem is when the option to show variations of the variable product as simple products on the shop page is enabled.
I want that by default in the entire shop, out-of-stock products are never displayed.
https://prnt.sc/EDXClGTLbqzO
https://prnt.sc/38TPu95CGy3u
Thanks
Hello,
Please provide URL of the variable product that has out-of-stock variations.
Also, check FTP access – https://prnt.sc/ZeD9YG-8RM1e , we can’t connect.
Regards
Thanks, re-send data in private content area.
Hello,
Ok, thank you. What about the variable product link that we also asked about in our previous message?
Regards
Hello,
What I really want is for out-of-stock products not to appear anywhere.
Right now if you access any part of the shop you will see that products with the label “AGOTADO” appear. https://resetaccessories.com/shop/?lang=es
From what I’ve seen, it only happens with variable products that are displayed as simple with the Xstore option.
It would be great if you could tell me the code of the action so that I can modify the behavior in the functions.php of the child theme, like a
add_filter( ‘woocommerce_loop_…..
or
add_action( ‘woocommerce_product_query…. or anyone, I don’t know which one is right.
I also want to hide the ones that have a price of 999eur. For this I would use the same hook in functions.php.
Thanks
Hello,
I understood your request. I have passed the issue to our developers. I’ll inform you once they fix the problem.
Regards
Hello,
Please clear all cache and check now. Let us know
Regards
Hello,
Perfect now out-of-stock products do not appear. Thanks!!
But we have a bigger problem, now the page takes a long time to load each request. It is not operational.
Where can I see the updated code?
Thanks
Hello,
We did some extra conditions to prevent loading out-of-stock variations but we used before and now WordPress transients that allow us to keep values (ids of variations) for some time and not make a new request every time on page load. It means that we make a request only once a day and all other times we return the variations ids (set earlier) from transients.
More about transients -> https://developer.wordpress.org/apis/handbook/transients/
xstore/framework/woo.php
function – etheme_product_variations_excluded
Regards
Tagged: best, categories, hide, loop, out-stock, selling, shop, themes, variation, woocommerce
You must be logged in to reply to this topic.Log in/Sign up