Skip to content

Instantly share code, notes, and snippets.

@elimn
Created February 21, 2017 18:05
Show Gist options
  • Save elimn/ed648363bbac1061e37bdbf7ecb720b3 to your computer and use it in GitHub Desktop.
Save elimn/ed648363bbac1061e37bdbf7ecb720b3 to your computer and use it in GitHub Desktop.
MT | ETP | Hides the Woo Quantity fields on the cart pages
<?php
/**
* Hide the WooCommerce quantity adjustment fields on cart pages
*/
function tribe_hide_woo_quantity_change() {
if ( ! is_cart() ) {
return;
}
$js = 'jQuery( ".cart_item input[type=number]" ).each( function(){ this.type = "hidden"; });';
printf(
'<script type="text/javascript">%s</script>',
$js
);
}
add_action( 'wp_footer', 'tribe_hide_woo_quantity_change' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment