WooCommerce Product Sample has a maximum quantity feature built-in. This lets you set the maximum number of sample products that can be purchased per order.
When you set a maximum quantity, you can control the logic of how it is calculated. The options are:
Set a maximum number of samples per order
Set a maximum number of samples per category
Set a maximum number of samples per product/variation
For even more control over sample quantities, you can use WooCommerce Product Sample with our other plugins - WooCommerce Quantity Manager. This has more advanced options for setting quantity rules for your samples or other products, including:
Set a minimum AND maximum number of sample products
Create minimum and maximum order values, instead of basing it on quantity
Add quantity rules for your other products too - not just samples