Archived topic
Change the WC single product minus button
3 replies · Started by David R on January 31, 2021
I find it peculiar that the plus and minus buttons on the WC single product page are added by javascript, but I suppose there is some good reason to go that route over php and templates.
However, because those buttons are added that way, there doesn't appear to be a good way to change the characters used in those buttons. It would be nice to change those characters to up and down arrows/chevrons. Also, the use a regular hyphen for minus makes it too small, in my opinion. An EN dash or EM dash would be more suitable.
Is there something I'm missing that would make a change to these characters easy?
Hi there,
The quantity buttons are taken directly from the WooCommerce plugin. The theme doesn't control what is being displayed. It's from woocommerce/templates/global/quantity-input.php.
As this is a third party plugin, it's best to ask the plugin developer on what's the best practice on which to customize this particular feature.
I believe some third party plugins are offering this feature. Consider trying them out. :)
GP-Premium woocommerce/functions/js/woocommerce.js
// Add plus and minus icons
box.parent().addClass( 'buttons-added' ).prepend('<a href="javascript:void(0)" class="minus">-</a>');
box.after('<a href="javascript:void(0)" class="plus">+</a>');
That's where it's coming from.
Hi there,
that code is not currently filterable, but we are reviewing Woo options for a future update and we'll be looking at this function.
JS was used, as we don't like replacing woo templates so we can maintain compatibility.
The feature can be disabled in Customizer > Layout > Woocommerce. Which would leave you with the default Woo layout.