Skip to content

Instantly share code, notes, and snippets.

@derekmorash
Created January 10, 2018 17:22
Show Gist options
  • Save derekmorash/7ddf80d2eb3d60dec60e9686f6a82a93 to your computer and use it in GitHub Desktop.
Save derekmorash/7ddf80d2eb3d60dec60e9686f6a82a93 to your computer and use it in GitHub Desktop.
A shopify script to give porducts with a quantity of 2 or more 10% off
Input.cart.line_items.each do |line_item|
next if line_item.variant.product.gift_card? || line_item.quantity <= 1
line_item.change_line_price(line_item.line_price * 0.90, message: "10% 2 or more")
end
Output.cart = Input.cart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment