This file contains 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
<div class="snow"></div> | |
<style> | |
.editor-stage .snow { | |
height:50px; | |
background: #fff; | |
} | |
.snow{ | |
position:fixed; | |
pointer-events:none; | |
top:0; |
This file contains 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
min_discount_order_amount = Money.new(cents:100) * 50 | |
total = Input.cart.subtotal_price_was | |
discount = if total > min_discount_order_amount | |
1 | |
else | |
0 | |
end | |
message = "Free shipping if order is over $50" | |
Input.shipping_rates.each do |shipping_rate| |
This file contains 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
discounted_product = 12275195905 | |
products_needed = [592406273] | |
products_seen = [] | |
Input.cart.line_items.each do |line_item| | |
product = line_item.variant.product | |
products_seen << product.id if products_needed.include?(product.id) | |
end | |
Input.cart.line_items.each do |line_item| |
This file contains 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
{% assign sizes = '' %} | |
{% for product in products limit: limit %} | |
{% for variant in product.variants %} | |
{% if variant.available %} | |
{% assign sizes = sizes | append: variant.options[1] | append: '_' %} | |
{% endif %} | |
{% endfor %} | |
{% endfor %} | |
{% assign sizesArr = sizes | split: '_' | uniq %} |
This file contains 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
customer = Input.cart.customer | |
discount = 0 | |
message = "" | |
if customer | |
if customer.orders_count < 1 | |
discount = 1000 #discount amount in cents | |
message = "New Customer - $10 off" | |
end | |
end | |
puts discount |
This file contains 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
DISCOUNTS_BY_QUANTITY = { | |
10_000 => 20, | |
1_000 => 15, | |
100 => 10, | |
10 => 5, | |
} | |
Input.cart.line_items.each do |line_item| | |
next if line_item.variant.product.gift_card? |
This file contains 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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | |
{% assign found_title = false %} | |
{% for item in checkout.line_items %} | |
{% if item.variant.id == 7387208286253 %} | |
{% assign found_title = true %} | |
{% endif %} | |
{% endfor %} | |
{% if checkout.subtotal_price > 10000 and found_title == false %} | |
<script> |
This file contains 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
{% assign color_active = false %} | |
{% for option in product.options %} | |
{% if option == 'Color' %} | |
{% assign color_active = true %} | |
{% endif %} | |
{% endfor %} | |
{% if product.variants.size > 1 and color_active == true %} | |
{% for option in product.options %} | |
{% if option == 'Color' or option == 'Colour' %} | |
{% assign index = forloop.index0 %} |
This file contains 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
{% for product in collection.products %} | |
{% assign color_active = false %} | |
{% for option in product.options %} | |
{% if option == 'Color' %} | |
{% assign color_active = true %} | |
{% endif %} | |
{% endfor %} | |
{% if product.variants.size > 1 and color_active == true %} | |
{% for option in product.options %} | |
{% if option == 'Color' %} |
This file contains 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
<button type="submit" name="add" class="action_button add_to_cart {% if product.handle contains 'oil-pulling-pack' %}free_item{% endif %}" data-label={{ add_to_cart_label | json }}> |
NewerOlder