• Resolved RenewMyID

    (@renewmyid)


    Hi, I’m running a webshop and noticed that when enabling the option “Hide out of stock items” (woocommerce_hide_out_of_stock_items) on the Settings > Products > Inventory page, also products that are labeled as instock are missing on the category pages.

    I backtraced it to the product object ID existing in the MySQL table “wp_term_relationships” for the taxonomy term “outofstock” for “product_visibility”.
    The product should not have this relation i think, on updating the stock the term relation should be removed.

    Now i can’t use the setting for hiding out of stock products, or is there a way to fix this? Thanks in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    This kind of problem is usually caused by a conflict with your theme or with another plugin. The best way to determine this is to:

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Test to see if the issue has been resolved

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.

    Thread Starter RenewMyID

    (@renewmyid)

    Hi Maykato,

    I just tried that. It does not fix the problem. But removing the product ID from the wp_term_relationships does fix it. So it seems it is database related. A product labeled instock should not have a relation to the outofstock term in this table. But it does.

    Any ideas?

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    when enabling the option “Hide out of stock items” (woocommerce_hide_out_of_stock_items) on the Settings > Products > Inventory page, also products that are labeled as instock are missing on the category pages.

    Unless you changed something in the database or have some custom coding, the default behavior is that enabling that option would hide out-of-stock products while in-stock products will not be hidden.

    In order for us to get a better idea of your setup, 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.

    Thanks.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    It’s been a while since we last heard from you, so I’m marking this thread as resolved.

    Hopefully, you’ve been able to resolve this, but we’ll be here if and/or when you are ready to continue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide products out of stock, also hides product labeled “instock”’ is closed to new replies.