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
{ | |
"name": "Notification Pop up", | |
"settings": [ | |
{ | |
"type": "header", | |
"content": "Notification pop up setting" | |
}, | |
{ | |
"type": "checkbox", | |
"id": "popup_enable", |
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
@import url(//fonts.googleapis.com/css?family=Raleway:300,700); | |
#someone-purchased{background:#fff;border:0;display:none; | |
border-radius:0;bottom:20px;left:20px;top:auto !important;right:auto !important;padding:0;position:fixed;text-align:left;width:auto;z-index:99999;font-family:Raleway,sans-serif;-webkit-box-shadow:0 0 4px 0 rgba(0,0,0,.4);-moz-box-shadow:0 0 4px 0 rgba(0,0,0,.4);box-shadow:0 0 4px 0 rgba(0,0,0,.4);} | |
#someone-purchased div img{cursor:pointer;float:left;max-height:85px; | |
max-width:120px;width:auto}#someone-purchased div p{color:{{ settings.popup_message }};float:left;font-size:13px;margin:0 0 0 13px;width:auto;padding:10px 10px 0 0;line-height:20px} | |
#someone-purchased div p a{padding-right: 51px; color:{{ settings.popup_product_title_olor }} !important; display:block;font-size:15px;font-weight:700} | |
#someone-purchased div p a:hover{color:#000}#someone-purchased div p small{text-align: right; display:block;font-size:10px;margin-bottom:8px;} |
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> | |
$(function() { | |
$('#someone-purchased').show(); | |
var mytimeAgo = ['20 seconds', '34 seconds','35 seconds', '43 seconds','1 minute', '5 minutes', '10 minutes', '12 minutes', '14 minutes', '16 minutes', '18 minutes', '20 minutes', '25 minutes', '30 minutes', '35 minutes', '40 minutes','42 minutes','45 minutes', '50 minutes', '1 hours']; | |
var randomlytimeAgo = Math.floor(Math.random() * mytimeAgo.length); | |
var currentmytimeAgo = mytimeAgo[randomlytimeAgo]; |
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
Input.shipping_rates.each do |shipping_rate| | |
shipping_rate.apply_discount(shipping_rate.price, { message: shipping_rate.source }) | |
end | |
Output.shipping_rates = Input.shipping_rates |
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
MESSAGE = "Free Standard Shipping" #promotional message | |
Input.shipping_rates.each do |shipping_rate| | |
next unless shipping_rate.source == "shopify" | |
next unless shipping_rate.name == "Free Standard Shipping" | |
shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE) | |
end | |
Output.shipping_rates = Input.shipping_rates |
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
MINIMUM_ORDER_AMOUNT = 75 #dollars required in cart to get discount | |
MESSAGE = "Spend Just 75$ & Get Freeshipping" #promotional message | |
if !Input.cart.shipping_address.province.include?("Newyork") && !Input.cart.shipping_address.province.include?("Newyork") | |
if Input.cart.subtotal_price_was > (Money.new(cents:100) * MINIMUM_ORDER_AMOUNT) | |
Input.shipping_rates.each do |shipping_rate| | |
if shipping_rate.name.include?("3 Day Ground") | |
shipping_rate.change_name("Free Three Day Ground", { message: "" }) | |
shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE) | |
end |
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
MINIMUM_ORDER_AMOUNT = 75 #dollars required in cart to get discount | |
MESSAGE = "Free shipping if you order over 75" #promotional message | |
if Input.cart.subtotal_price_was > (Money.new(cents:100) * MINIMUM_ORDER_AMOUNT) | |
Input.shipping_rates.each do |shipping_rate| | |
next unless shipping_rate.source == "shopify" | |
shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE) | |
end | |
end |
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
MINIMUM_ORDER_AMOUNT = 75 #dollar amount required in cart to get discount | |
DISCOUNT = 0.2 #percentage discount (in decimal format) | |
MESSAGE = "20% off on shipping if your order is over $75" #promotional message | |
if Input.cart.subtotal_price_was => (Money.new(cents:100) * MINIMUM_ORDER_AMOUNT) | |
Input.shipping_rates.each do |shipping_rate| | |
next unless shipping_rate.source == "shopify" | |
shipping_rate.apply_discount(shipping_rate.price * DISCOUNT, message: MESSAGE) | |
end | |
end |
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
TAG = "vip" #customer tag | |
MESSAGE = "VIP Customer Reward" #additional message | |
customer = Input.cart.customer | |
if customer | |
if customer.tags.include?(TAG) | |
Input.shipping_rates.each do |shipping_rate| | |
if shipping_rate.name.include?("Insured Shipping and Handling (USPS Priority Express)") | |
shipping_rate.change_name("FREE VIP GROUND SHIPPING (USPS Priority Express)", { message: "" }) | |
shipping_rate.apply_discount(shipping_rate.price, message: MESSAGE) |