woocommerce_quantity_input()
Output the quantity input for add to cart forms.
Хуков нет.
Возвращает
string.
Использование
woocommerce_quantity_input( $args, $product, $echo );
- $args(массив)
- Args for the input.
По умолчанию:array() - $product(WC_Product|null)
- Product.
По умолчанию:null - $echo(true|false)
- Whether to return or echo|string.
По умолчанию:true
Код woocommerce_quantity_input() woocommerce quantity input WC 11.1.2
function woocommerce_quantity_input( $args = array(), $product = null, $echo = true ) {
$product = is_null( $product ) ? $GLOBALS['product'] : $product;
$args = wc_get_quantity_input_args( $args, $product );
ob_start();
wc_get_template( 'global/quantity-input.php', $args );
if ( $echo ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo ob_get_clean();
} else {
return ob_get_clean();
}
}