woocommerce_before_add_to_cart_quantity

woocommerce_before_add_to_cart_quantity

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: woocommerce.9.3.3

do_action('woocommerce_before_add_to_cart_quantity') is found 3 times:

  • /templates/single-product/add-to-cart/grouped.php line 69
    							} elseif ( $grouped_product_child->is_sold_individually() ) {
    								echo '<input type="checkbox" name="' . esc_attr( 'quantity&#91;' . $grouped_product_child->get_id() . ']' ) . '" value="1" class="wc-grouped-product-add-to-cart-checkbox" id="' . esc_attr( 'quantity-' . $grouped_product_child->get_id() ) . '" />';
    								echo '<label for="' . esc_attr( 'quantity-' . $grouped_product_child->get_id() ) . '" class="screen-reader-text">' . esc_html__( 'Buy one of this item', 'woocommerce' ) . '</label>';
    							} else {
    								do_action( 'woocommerce_before_add_to_cart_quantity' );
    
    								woocommerce_quantity_input(
    									array(
    										'input_name'  => 'quantity[' . $grouped_product_child->get_id() . ']',
    										'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : '', // phpcs:ignore WordPress.Security.NonceVerification.Missing
    										'min_value'   => apply_filters( 'woocommerce_quantity_input_min', 0, $grouped_product_child ),
    
  • /templates/single-product/add-to-cart/simple.php line 36
    	<form class="cart" action="<?php echo esc_url( apply_filters( 'woocommerce_add_to_cart_form_action', $product->get_permalink() ) ); ?>" method="post" enctype='multipart/form-data'>
    		<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
    
    		<?php
    		do_action( 'woocommerce_before_add_to_cart_quantity' );
    
    		woocommerce_quantity_input(
    			array(
    				'min_value'   => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
    				'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
    				'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // WPCS: CSRF ok, input var ok.
    
  • /templates/single-product/add-to-cart/variation-add-to-cart-button.php line 18
    <div class="woocommerce-variation-add-to-cart variations_button">
    	<?php do_action( 'woocommerce_before_add_to_cart_button' ); ?>
    
    	<?php
    	do_action( 'woocommerce_before_add_to_cart_quantity' );
    
    	woocommerce_quantity_input(
    		array(
    			'min_value'   => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
    			'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
    			'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( wp_unslash( $_POST['quantity'] ) ) : $product->get_min_purchase_quantity(), // WPCS: CSRF ok, input var ok.