• Hello,
    you have a big bug related to hidden products.
    While user set
    “Hide out of stock products in catalog” as ON, the products seems to be hidden, however result counter and pagination is broken – it counts with hidden products too!

    This is the snippet, which helped me.

    function show_only_instock_products($query) {
     $meta_query = $query->get( 'meta_query' );
     $meta_query[] = array(
     'key' => '_stock_status',
     'compare' => '=',
     'value' => 'instock'
     );
     $query->set( 'meta_query', $meta_query );
    }
    add_action('woocommerce_product_query', 'show_only_instock_products');
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi and thanks for posting!

    What you’re describing isn’t something we’ve seen reported recently. Updated versions of WooCommerce shouldn’t see this problem relating to ‘hidden’ products, as they should be correctly (not) displayed in results and pagination.

    I’d be interested to know whether you see this issue under test conditions – when you’re using a default theme (such as Storefront or Twenty Twenty One) and when no other plugins are active except WooCommerce, and when WooCommerce is updated to the latest version.

    Here’s some guidance on this: https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Please feel free to come back to us if you’re still seeing this. Thanks!

    Hello, I was using the Elementor, however, the problem persist, when I deactivated all plugins, except Woocommerce.
    The used template was Hello Elementor with my custom child theme (nothing in functions.php)…

    Hello,

    What versions of WooCommerce and WordPress do you have? Could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.

    Hi @lavadesign

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘BIG BUG related to hidden products’ is closed to new replies.