Skip to content

Instantly share code, notes, and snippets.

@daviddunnington
Last active September 16, 2019 09:57
Show Gist options
  • Save daviddunnington/97804707b2598fd543ba4998cba27e2d to your computer and use it in GitHub Desktop.
Save daviddunnington/97804707b2598fd543ba4998cba27e2d to your computer and use it in GitHub Desktop.
Woocommerce out of stock HTML filter product page
function filter_woocommerce_get_stock_html( $html, $product ) {
if ( $product->stock_status == 'outofstock' ) {
$html .= 'Add custom HTML here';
}
return $html;
}
add_filter( 'woocommerce_get_stock_html', 'filter_woocommerce_get_stock_html', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment