Question

I want to hide the quantity box for a specific products on the checkout cart page.

I have referred this link Magento 2: How to hide quantity box for certain products which has only quantity?

But it is not helping me out.

Any help would be appreciated.

Was it helpful?

Solution

Short version:
At first. Whats rule that defines which product should be visible with qty?
Specific category? Specific Attribute set? Specific attribute value?

Then on cart check those rules for every entity. By default phtml that displays qty is here:

module-checkout/view/frontend/templates/cart/item/default.phtml

But it may be somewhere else (depends on theme and project custom modules).
Search by qty.

I mean, create own module with logic that return false or true for qty input, override this phtml with block. Using block, call function that return bool for qty for specific product and show or not this input depends on bool.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top