woocommerce_quantity_input_min_admin
Filter to change the product quantity minimum in the order editor of the admin area.
Использование
add_filter( 'woocommerce_quantity_input_min_admin', 'wp_kama_woocommerce_quantity_input_min_admin_filter', 10, 3 ); /** * Function for `woocommerce_quantity_input_min_admin` filter-hook. * * @param string $step The current minimum amount to be used in the quantity editor. * @param WC_Product $product The product that is being edited. * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. * * @return string */ function wp_kama_woocommerce_quantity_input_min_admin_filter( $step, $product, $context ){ // filter... return $step; }
- $step(строка)
- The current minimum amount to be used in the quantity editor.
- $product(WC_Product)
- The product that is being edited.
- $context(строка)
- The context in which the quantity editor is shown, 'edit' or 'refund'.
Список изменений
С версии 5.8.0 | Введена. |
Где вызывается хук
woocommerce_quantity_input_min_admin
woocommerce/includes/admin/meta-boxes/views/html-order-item.php 91
$min_edit = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'edit' );
woocommerce/includes/admin/meta-boxes/views/html-order-item.php 92
$min_refund = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'refund' );