WooCommerce Out-of-Stock Products Still Visible Despite BeTheme Child Theme Customizations
Hello, BeTheme support team,
I'm experiencing an issue with the BeTheme integration on my WooCommerce site (https://nicoleta.store).
Issue: Despite using WooCommerce's built-in settings, custom CSS, and PHP code within a child theme, products (or variations) marked as "out of stock" are still appearing in the shop listings, search results, and product filters.
Actions I've already attempted:
- Enabled WooCommerce’s default setting to hide out-of-stock products (unsuccessful).
- Used custom CSS:
.outofstock { display: none !important; }
- Applied the following PHP snippet in a child theme:
add_action('pre_get_posts', function($query) { if (!is_admin() && $query->is_main_query() && (is_shop() || is_product_category() || is_product_tag() || is_search())) { $meta_query = $query->get('meta_query'); if (!is_array($meta_query)) { $meta_query = array(); } $meta_query[] = array( 'key' => '_stock_status', 'value' => 'outofstock', 'compare' => '!=' ); $query->set('meta_query', $meta_query); } });
I also used WooCommerce's recommended filter to hide out-of-stock variations:
add_filter('woocommerce_variation_is_in_stock', function($in_stock, $variation) { return $variation->is_in_stock() ? $in_stock : false; }, 10, 2);
Additional Debugging Information:
- PHP deprecated warnings related to dynamic property creation (
Be_custom_branding
from the becustom plugin).
Conclusion: The issue appears to be a conflict or incompatibility with BeTheme or another integrated component, preventing WooCommerce from hiding out-of-stock products as intended.
Could you please provide guidance on resolving this or suggest any necessary modifications to ensure that out-of-stock products or variations are hidden correctly?
Thanks for your prompt support!
Comments
Hi,
I checked your website, and I see no out-of-stock products:
Did you handle this in the meantime?
Best regards
Hi,
Thanks for your response. Let me clarify: the out-of-stock issue was not actually resolved. Since the previous solutions didn't work, I had to manually delete the out-of-stock products from WooCommerce temporarily as a test, and that's why you currently don't see them.
Could you please investigate this further or advise if there's a setting or conflict within BeTheme that's causing WooCommerce to display out-of-stock products?
Please send us the WordPress dashboard access privately through the contact form, which is on the right side at https://themeforest.net/user/muffingroup#contact and we will check what might be the reason.
Notice!
Please attach a link to this forum discussion.
Sending incorrect or incomplete data will result in a longer response time.
Therefore, please ensure that the data you send are complete and correct.
Thanks
Hi,
I have already sent all the requested information through the provided contact form. Please confirm if you've received it correctly.
Thanks, looking forward to your confirmation!
I added a new out-of-stock product, and it does not appear on your shop:
Also, for a test, I edited an existing product, which also disappeared.
Should I proceed with any steps to replicate your problem?
Best regards
Hi,
I want to inform you that the out-of-stock products still appear in several sections of the website, specifically in the related products area and product carousels.
Additionally, when filtering products by size, those products with the selected size out of stock continue to appear in the filtered results.
Could you please check these issues?
Thanks for your assistance!
product carousels
https://nicoleta.store/product/vestido-rojo-de-cuadros-con-manga-larga-para-nina/
related products
https://nicoleta.store/product/vestido-elegante-con-tul-y-estampado-floral-para-nina/
https://nicoleta.store/product/vestido-rosa-floral-para-nina-con-falda-de-tul/
Filter products
https://nicoleta.store/product/vestido-elegante-negro-con-manga-de-gasa-para-ninas/
1) Query Loops (which you used for related products) do not have the option to hide out-of-stock products.
If you would like to see this feature in future updates, please let us know on the following topic:
https://forum.muffingroup.com/betheme/discussion/113/your-suggestions-for-future-updates#latest
As a workaround, you can use the Shop slider element, which has the option:
2) This filter comes from WooCommerce and we do not have influence on its functionality. Regarding this, you should contact WooCommerce support instead.
Best regards