Created
September 21, 2016 09:40
-
-
Save rynaldos-zz/73a06958cb95d9fa618b6ed90bd961f3 to your computer and use it in GitHub Desktop.
Filter to add variable stock level totals back to admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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