It's been requested by multiple enterprise clients to remove discount code for particular products.
We thought to have 2 solution
- [](https://gist.github.com/ashukasma/a01df83ece9b869815965cf4bf6297b7#file-reject-discount-for-few-products-css)[](https://gist.github.com/ashukasma/a01df83ece9b869815965cf4bf6297b7#file-reject-discount-for-few-products-css)CSS Solution
[data-reduction-form="update"] { display: none }
- [](https://gist.github.com/ashukasma/a01df83ece9b869815965cf4bf6297b7#file-reject-discount-for-few-products-css)[](https://gist.github.com/ashukasma/a01df83ece9b869815965cf4bf6297b7#file-reject-discount-for-few-products-css)Shopify Scripts
#Reject Discount for few products reject = false Input.cart.lineitems.select do |lineitem| product = lineitem.variant.product if product.tags.include?('rejectcode') reject = true end end
if reject and Input.cart.discountcode Input.cart.discountcode.reject( message: "discount can't applied! for this product." ) end Output.cart = Input.cart

