WordPress action hook
woocommerce_before_quantity_input_field
Defined by WooCommerce and fired by 18 plugins in total, running on 7M+ sites between them.
“Hook to output something before the quantity input field.”
How to use woocommerce_before_quantity_input_field
It's an action: your callback runs at that point. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'woocommerce_before_quantity_input_field', function() {
// Your code runs here.
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
18 plugins that fire woocommerce_before_quantity_input_field
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
do_action( 'woocommerce_before_quantity_input_field' )templates/global/quantity-input.php:34 -
Quantity Plus Minus Button for WooCommerce10,000+ installs
do_action( 'woocommerce_before_quantity_input_field' )template/global/quantity-input.php:95 -
CartSuite5,000+ installs
do_action( 'woocommerce_before_quantity_input_field' )includes/frontend/frontend.php:227 -
Min Max Step Quantity Limits Manager for WooCommerce3,000+ installs
do_action( 'woocommerce_before_quantity_input_field' )includes/templates/global/quantity-html5-input.php:30 -
WPC Product Quantity for WooCommerce2,000+ installs
do_action( 'woocommerce_before_quantity_input_field' )templates/quantity-input.php:84 -
Direct Checkout1,000+ installs
do_action( 'woocommerce_before_quantity_input_field' )templates/global/default-quantity-input.php:31 -
Better Usability for WooCommerce700+ installs
do_action( 'woocommerce_before_quantity_input_field' )templates/qty-select-cart.php:9 -
ShopPress600+ installs
do_action( 'woocommerce_before_quantity_input_field' )public/templates/global/quantity-input-modern.php:19 -
StoreBuild400+ installs
do_action( 'woocommerce_before_quantity_input_field' )public/woocommerce/global/quantity-input.php:36 -
Visual Builder200+ installs
do_action( 'woocommerce_before_quantity_input_field' )inc/woocommerce/single-product/add-to-cart/preview-add-to-cart.php:14 -
ShopMaker90+ installs
do_action( 'woocommerce_before_quantity_input_field' )templates/global/quantity-input.php:31 -
BlindMatrix e-Commerce10+ installs
do_action( 'woocommerce_before_quantity_input_field' )templates/bm-quantity-input.php:34 -
Templates Add-on for Woo OnePage10+ installs
do_action( 'woocommerce_before_quantity_input_field' )includes/variation-swatch/templates/quantity-input.php:26 -
StorzenFewer than 10 installs
do_action( 'woocommerce_before_quantity_input_field' )woocommerce/global/quantity-input.php:32 -
Total Cost Input for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_quantity_input_field' )templates/global/quantity-input.php:208 -
Arshida Toolkit for WooCommerceFewer than 10 installs
do_action( 'woocommerce_before_quantity_input_field' )src/Templates/woocommerce/global/quantity-input.php:25 -
Min Max Quantity Controls for WooCommerce with Step ControlFewer than 10 installs
do_action( 'woocommerce_before_quantity_input_field' )includes/templates/global/quantity-input.php:111 -
Ajax mini cart for WoocommerceFewer than 10 installs
do_action( 'woocommerce_before_quantity_input_field' )src/zt-front-end.php:436
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.