Archived topic
Disable Quantity on Product Page when Sold Individually is checked
1 reply · Started by Webmaster on January 18, 2023
How do I hide the Quantity Input field without using CSS? I tried this option but the input field was still being displayed to the left of the Add to cart button.
If Sold Individually is checked, the quantity field should be hidden on the product page? In GeneratePress the quantity input field is still shown if so... maybe this is something that should be added to GIT for feature request or bug fix.
I'm about to dig around on the web for a hook to disable the quantity field right now because I tried to remove the quantity field with a snippet of CSS but it didn't work:
.quantity.buttons-added {
display: none;
}
p.s. - my apologies upfront if this is wasting your time... i saw this post but there was no answer
Hello there,
How about this PHP snippet suggested here?: https://stackoverflow.com/questions/14757373/how-to-disable-the-quantity-field-in-the-product-detail-page-in-woocommerce#:~:text=The%20safest%20way%20is%20to%20use%20WordPress%20builtin%20hook%20or%20filter
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
Does that work?
It may also be good to raise a topic here: https://wordpress.org/support/plugin/woocommerce/