I am using this code to limit the quantity the customers can buy per product :
add_filter( 'woocommerce_available_variation', 'woo_quantity_max_variation', 9999, 3 );
function woo_quantity_max_variation( $args, $product, $variation ) {
$args['max_qty'] =3;
return $args;
}
I need to add a message in the single product page (maybe over or under the quantity) that says for example "Max quantity is 3 units per customer"
Thanks!
2
Answers
You can use
view complete document here http://hookr.io/functions/wc_add_notice/
You can add the message before the quantity input using
woocommerce_before_add_to_cart_quantity
action hook.