Skip to content

Instantly share code, notes, and snippets.

@woogist
Created May 4, 2015 09:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woogist/20e3068c0fc5be376fcd to your computer and use it in GitHub Desktop.
Save woogist/20e3068c0fc5be376fcd to your computer and use it in GitHub Desktop.
if ( ! is_shop() && ! is_product_taxonomy() ) {
$quantity_field = woocommerce_quantity_input( array(
'input_name' => 'product_id',
'input_value' => ! empty( $product->cart_item['quantity'] ) ? $product->cart_item['quantity'] : 0,
'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity(),
'min_value' => 0,
), $product, false );
$quantity_field = str_replace( array( '<div class="quantity">', "</div>" ), '', $quantity_field );
echo str_replace( '<input ', '<input style="max-width: 70px" ', $quantity_field );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment