• Is there a way to set all products to ‘manage stock’ ON by default?

    I have a WC site with +4000 products and we use a stock management program to manage the stock but it requires each product to have this setting ‘on’ to be able to override the stock settings. We then do lots of bulk pricing updates by CSV but with so many products, occassionally the ‘manage stock’ setting gets turned off on products after bulk updating prices.

    It’s PAINFUL at best to turn it back on manually as I can only do 300-500 products at a time… is there a way to write a function for WC that will set this manage stock to ON always?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I had the same problem today (we have +10000 products).

    Found that some products with stock=1 where still available on the store and found this was the issue. I am currently searching for the same solution you are looking for but, meanwhile, this simple query may help you to update all products at once:

    UPDATE wp_postmeta
    SET meta_value = ‘yes’
    WHERE meta_key LIKE ‘_manage_stock’;

    If I found a way to set the “Manage stock” default to ON, I will post it here

    Thread Starter SeanAUS120

    (@seanaus120)

    Hey @sigmareef much appreciated! Finally had a chance to go through this.

    The solution on stackoverflow manages to get the ‘Manage Stock’ optional to automatically be ticked on all products (yes!), however, unless you set a default stock level in the code, it changes all products to ‘0’ in stock level. Whenever I set it to any number, eg. 5, then our stock management system cannot override WooCommerce to give the correct stock it just keeps changing back to ‘5’ because of this snippet.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Set all products to ‘manage stock’ by default.’ is closed to new replies.