If a product is set to be sold individually, let's hide the quantity input.
Fixes #2085.
Screenshots
Regular Product
Sold Individually
The above shows how things will look once this change is applied (the quantity input will be hidden, if the product is set to be sold individually).
How to test the changes in this Pull Request:
Configure a product to be sold individually.
View the corresponding single product page (and please test this against WooCommerce 7.2.0 or higher).
With this change, the quantity input should be hidden.
Without this change, the quantity input will still be visible.
Confirm the quantity input always renders for products that are not set to be sold individually.
💡 When testing this branch, be sure to rebuild the stylesheets using npm run build:css. You may also need to clear your browser cache to see the change.
Changelog
Fix – Hide the single product page quantity selector if the product is sold individually. #2085
Closing: we've reverted the corresponding change in WooCommerce (when the input should be hidden, it will once again be set to type="hidden") and so no longer require a CSS solution.
If a product is set to be sold individually, let's hide the quantity input.
Fixes #2085.
Screenshots
The above shows how things will look once this change is applied (the quantity input will be hidden, if the product is set to be sold individually).
How to test the changes in this Pull Request:
💡 When testing this branch, be sure to rebuild the stylesheets using
npm run build:css
. You may also need to clear your browser cache to see the change.Changelog