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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
scroll top