Skip to content

Instantly share code, notes, and snippets.

@rynaldos-zz
Created September 21, 2016 09:40
Show Gist options
  • Save rynaldos-zz/73a06958cb95d9fa618b6ed90bd961f3 to your computer and use it in GitHub Desktop.
Save rynaldos-zz/73a06958cb95d9fa618b6ed90bd961f3 to your computer and use it in GitHub Desktop.
Filter to add variable stock level totals back to admin
add_filter( 'woocommerce_admin_stock_html', 'tmt_show_variation_stock_level', 10, 2 );
function tmt_show_variation_stock_level( $stock_html, $the_product ) {
if( sizeof( $the_product->get_children() ) ) {
$stock_html .= ' (' . $the_product->get_total_stock() . ')';
}
return $stock_html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment