Created
November 19, 2017 19:33
-
-
Save svaustin66/e2c156d64326f5ce0e2c065aa303838c to your computer and use it in GitHub Desktop.
Shopify Script for Dynamic Pricing of RUSH ORDER Product
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
# Rush Order | |
Input.cart.line_items.each do |line_item| | |
product = line_item.variant.product | |
next unless product.id == 12097978371 | |
subtotal_without_item = Input.cart.subtotal_price_was - line_item.line_price | |
line_item.change_line_price(subtotal_without_item * 0.2, message: "Rush Order fee is 20%") | |
end | |
Output.cart = Input.cart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment