Most browsers show “up and down” arrows inside number inputs. The WooCommerce add to cart quantity is a number input also, which means this will get the arrows as well.
But especially when you have add to cart plus minus buttons, the up and down arrows become useless. So, here’s a way to hide them via custom CSS.
Enjoy!
PHP Snippet: Hide Number Input Arrows/Spinners @ WooCommerce Single Product Page
/**
* @snippet Hide arrows @ add to cart quantity input
* @tutorial Get CustomizeWoo.com FREE
* @author Rodolfo Melogli, Business Bloomer
* @compatible WooCommerce 8
* @community Join https://businessbloomer.com/club/
*/
add_action( 'woocommerce_before_single_product', 'bbloomer_remove_input_number_arrows' );
function bbloomer_remove_input_number_arrows() {
?>
<style type="text/css">
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
</style>
<?php
}
Unfortunately this snipped doesn’t seem to work anymore.
This hides the “input number” default browser spin arrows. Maybe your theme or a plugin are customizing these already and the code doesn’t work? This still works for me on the WooCommerce Single Product page – Storefront theme