I'd love to be able to use the "Sold individually" toggle and keep things simple... But I have a Name Your Price plugin going, and the price can only be edited before the 'Add to Cart' button is hit. If someone changes their mind and wants to enter a different price after that, I'd rather they could just do it there, and then delete the old price at the Cart stage (rather than having to go into Cart and delete it first, then come back and go again... yeah).
So, I'm fine with all the quantity fields being gone or locked (the product is a digital download), but the prevention of multiple additions to cart is a problem in this case. Needless to say, quantity field hiding fixes using 'woocommerce_is_sold_individually' are out.
I've also seen things of this style suggested online, but haven't got any of them to work:
add_action( 'wp_head', 'quantity_wp_head' );
function quantity_wp_head() {
if ( is_product() ) {
?>
<style type="text/css">.quantity, .buttons_added { width:0; height:0; display: none; visibility: hidden; }</style>
Does anyone have a better solution?