Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mistercode

    (@mistercode)

    Hello @mihirshirke and @saffiretech.

    Unfortunately, this problem still exists.

    I found out that the problem with the wrong number of products occurs when the option

    By default, all products that are marked as 'Discontinued' won't appear in catalog & search results. Uncheck this,if you want to see Discontinued Products in catalog and search results.

    is activated. If this option is not activated, the correct number of products is displayed.

    Could you have a look into this, please? Or let me know if you are not interested in fixing this. I will than try to finde someone who can do it. Thanks!

    Plugin Author SaffireTech

    (@saffiretech)

    @mistercode Apologies for a late response. Unfortunately, this is not something that can be fixed. The problem with WooCommerce is that it maintains number of products with their stock status’ in 2 different places in database. One is internal product table and the other is
    The product count varies because it comes from product lookup table where we aren’t changing the stock status to ‘Discontinued’ from ‘Out-of-stock’. Ideally this table isn’t to be modified as it is used by WooCommerce for different internal purposes. (like searching products in the backend). We also don’t have any hooks to update the product count either. So, the only workaround is that you stop displaying the product count.

    Thread Starter mistercode

    (@mistercode)

    Thank you @saffiretech for your answer.

    I do not realy understand your point. The issue with the hight product count appears only ont he very first category of the category tree. The number on all subcategories are correct. And it worked in the past. Since one of your latest updates this issue came up.

    I can imagine there is an issue with your function of counting the number of discontinued products per category when the category is the root category.

    Plugin Author SaffireTech

    (@saffiretech)

    @mistercode We have reviewed your query again and found a possible reason why the category counts might be affected. To change the catalog visibility of a product to display in ‘Shop and search results,’ follow these steps:

    In your WordPress dashboard, go to Products > All Products, edit the product, locate the Catalog visibility option in the Publish section, click Edit, select Shop and search results, and click Update to save the changes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.