0

I'm trying to find a filter that would allow to elegantly override product stock, specifically variable product. As if the product has multiple warehouses each having a separate quantity, so the total stock becomes the summ of all warehouses.

As an example, let's assume that we sell shoes and want multiple separate stocks for each shoe size:

Shoe A
  Shoe size 1
    Warehouse 1 stock
    Warehouse 2 stock
  Shoe size 2
    Warehouse 1 stock
    Warehouse 2 stock
Shoe B
  Shoe size 1
    Warehouse 1 stock
    Warehouse 2 stock
  Shoe size 2
    Warehouse 1 stock
    Warehouse 2 stock
  Shoe size 3
    Warehouse 1 stock
    Warehouse 2 stock

So far I've found that WooCommerce grabs stock from WC_Product method get_stock_quantity (github link). But I can't find any filter that would allow overriding it. Can someone please suggest a direction on where to go?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.