Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php // only copy if needed
/**
* Removes the stock / availability HTML from the product variation
* since this is added via js the stock HTML filter is ignored
*
* @param array $data the variation data
* @return array updated data
*/
function sww_wc_remove_variation_stock_display( $data ) {
unset( $data['availability_html'] );
return $data;
}
add_filter( 'woocommerce_available_variation', 'sww_wc_remove_variation_stock_display', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment