Skip to content

Instantly share code, notes, and snippets.

@bulentsakarya
Created December 8, 2019 20:35
Show Gist options
  • Save bulentsakarya/68599ddb3d0c6ffd10fc55bdfeb3f724 to your computer and use it in GitHub Desktop.
Save bulentsakarya/68599ddb3d0c6ffd10fc55bdfeb3f724 to your computer and use it in GitHub Desktop.
WooCommerce ürün satış miktarını değiştirme
/*
* Changing the maximum quantity to 5 for all the WooCommerce products
*/
function woocommerce_quantity_input_max_callback( $max, $product ) {
$max = 5;
return $max;
}
add_filter( 'woocommerce_quantity_input_max', 'woocommerce_quantity_input_max_callback', 10, 2 );
/*
* Changing the minimum quantity to 2 for all the WooCommerce products
*/
function woocommerce_quantity_input_min_callback( $min, $product ) {
$min = 2;
return $min;
}
add_filter( 'woocommerce_quantity_input_min', 'woocommerce_quantity_input_min_callback', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment