woocommerce_quantity_input_max

woocommerce_quantity_input_max

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_quantity_input_max') is found 5 times:

  • /includes/wc-template-functions.php line 2010
    2006
    2007
    2008
    2009
    2010
    2011
    2012
    2013
    2014
    2015
    2016
    'input_id'     => uniqid( 'quantity_' ),
    'input_name'   => 'quantity',
    'input_value'  => '1',
    'classes'      => apply_filters( 'woocommerce_quantity_input_classes', array( 'input-text', 'qty', 'text' ), $product ),
    'max_value'    => apply_filters( 'woocommerce_quantity_input_max', -1, $product ),
    'min_value'    => apply_filters( 'woocommerce_quantity_input_min', 0, $product ),
    'step'         => apply_filters( 'woocommerce_quantity_input_step', 1, $product ),
    'pattern'      => apply_filters( 'woocommerce_quantity_input_pattern', has_filter( 'woocommerce_stock_amount', 'intval' ) ? '[0-9]*' : '' ),
    'inputmode'    => apply_filters( 'woocommerce_quantity_input_inputmode', has_filter( 'woocommerce_stock_amount', 'intval' ) ? 'numeric' : '' ),
    'product_name' => $product ? $product->get_title() : '',
    'placeholder'  => apply_filters( 'woocommerce_quantity_input_placeholder', '', $product ),
  • /src/Blocks/BlockTypes/AddToCartWithOptionsQuantitySelector.php line 148
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
             * @since 2.0.0
             * @param int        $max_value Maximum quantity value.
             * @param WC_Product $product   Product object.
             */
            '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(), // phpcs:ignore WordPress.Security.NonceVerification.Missing
        )
    );
     
    $product_html = ob_get_clean();
  • /templates/single-product/add-to-cart/grouped.php line 94
    090
    091
    092
    093
    094
    095
    096
    097
    098
    099
    100
            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 ),
                'max_value'   => apply_filters( 'woocommerce_quantity_input_max', $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child ),
                'placeholder' => '0',
            )
        );
     
        do_action( 'woocommerce_after_add_to_cart_quantity' );
    }
  • /templates/single-product/add-to-cart/simple.php line 41
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    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.
        )
    );
     
    do_action( 'woocommerce_after_add_to_cart_quantity' );
    ?>
  • /templates/single-product/add-to-cart/variation-add-to-cart-button.php line 23
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    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.
        )
    );
     
    do_action( 'woocommerce_after_add_to_cart_quantity' );
    ?>