Created
November 9, 2018 18:52
-
-
Save kmeister2000/10b06fe23bb28da54f8baf9fbb18fd2e to your computer and use it in GitHub Desktop.
Apply 30% discount to each item when purchasing 3 or more
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return unless Input.cart.line_items.count < 3 | |
Input.cart.line_items.each do |item| | |
item.change_line_price(item.line_price * .7, "Quantity discount applied!") | |
end | |
Output.cart = Input.cart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment