Skip to content

Instantly share code, notes, and snippets.

@ashukasma
Last active March 27, 2018 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashukasma/a01df83ece9b869815965cf4bf6297b7 to your computer and use it in GitHub Desktop.
Save ashukasma/a01df83ece9b869815965cf4bf6297b7 to your computer and use it in GitHub Desktop.
Shopify Scripts
[data-reduction-form="update"] {
display: none
}
#Reject Discount for few products
reject = false
Input.cart.line_items.select do |line_item|
product = line_item.variant.product
if product.tags.include?('reject_code')
reject = true
end
end
if reject and Input.cart.discount_code
Input.cart.discount_code.reject(
message: "discount can't applied! for this product."
)
end
Output.cart = Input.cart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment