Created
January 15, 2023 16:24
Customizing the Maximum Quantity in WooCommerce with Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_quantity_input_max', 'custom_woocommerce_quantity_input_max', 10, 2 ); | |
/** | |
* Setting max quantity to 1000. | |
* | |
* @param integer $max . | |
* @param object $product . | |
*/ | |
function custom_woocommerce_quantity_input_max( $max, $product ) { | |
$max = 1000; | |
return $max; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment