Skip to content

Instantly share code, notes, and snippets.

@jamesgol
Created September 17, 2021 17:34
Show Gist options
  • Save jamesgol/3d00dea11b1a0ea9e67f178739a64b51 to your computer and use it in GitHub Desktop.
Save jamesgol/3d00dea11b1a0ea9e67f178739a64b51 to your computer and use it in GitHub Desktop.
WooCommerce Cart Stock Reducer, get virtual and actual stock in code
$csr = WC()->integrations->get_integration('woocommerce-cart-stock-reducer');
$actual_stock = $csr->get_actual_stock_available( $product );
$virtual_stock = $csr->get_virtual_stock_available( $product );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment