Removing quantity input on woo commerce product page

Hi there,

I’m trying to remove the quantity input on single product pages. The struggle is that I need to be able to have more of the same product in the cart at once, which checking the ”Sold Individually" box under inventory makes impossible - can you help me solve this with a function or a filter?

Hi There,

Please try adding this custom CSS under X/Pro > Theme Options > CSS:

.single-product.woocommerce .quantity .qty {
    display: none;
}

Hope it helps :slight_smile:

Hi :slight_smile:

Thanks for the suggestion!

I was looking for a snippet to remove the quantity selector both on single product pages and the cart page. The customers should have the opportunity to buy more of the same item, however, I need them to go back to the product to add a new item to the cart, as they should be able to attach a unique internal reference number to each item. The item/product is a project in our system, and I need to offer the customers the opportunity to add their own internal project reference to the project they buy in our shop for the ease of their internal accounting.

I’ve found this snippet:

function woo_remove_all_quantity_fields( $return, $product ) { return true; } add_filter( ‘woocommerce_is_sold_individually’, ‘woo_remove_all_quantity_fields’, 10, 2 );

Like the inventory setting it makes it impossible to add more of the same item to cart afterwards. Do you have any suggestions on how to solve this problem?

Hi There,

Could you please try a plugin like this (https://wordpress.org/plugins/woocommerce-remove-quantity-fields/#reviews).

Hope that helps.

Hi there,

Thanks for the suggestion, I would prefer to solve the problem without a plugin though.

Hey There,

You might find this link useful: https://businessbloomer.com/woocommerce-display-separate-cart-items-product-quantity-1/

Regards.

Hi there,

Thanks for the link! It seems like the snippet should solve the problem, however, It still makes it impossible for me to add more of the same item to cart… I left a comment for Rodolfo, but if you have any suggestions on what’s wrong, please let me know :slight_smile:

Hi there,

It could be more on Woocommerce customization in which we can’t cover here in the forum as we’re not fully familiar with Woocommerce customization. But I would love to hear some result about this :slight_smile:

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.