Skip to content

Instantly share code, notes, and snippets.

@emilyemoss
emilyemoss / spend_$x_get_y%_off.rb
Created November 26, 2017 23:46
Shopify Script - Spend $X Get Y% Off
total = Input.cart.subtotal_price_was
# spend more than $150 earns 25% off
if total > Money.new(cents:100) * 150
discount = 0.25
message = "25% Off"
# spend between $50 and $150 earns 20% off
elsif total > Money.new(cents:100) * 50
discount = 0.20
message = "20% Off"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="{{ locale }}" dir="{{ direction }}" class="{{ checkout_html_classes }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, height=device-height, minimum-scale=1.0, user-scalable=0">
<title>{{ shop.name }} - {{ page_title }}</title>
{{ content_for_header }}
+ test gist for PC documentation
- test gist for PC documentation
+ test gist for PC documentation
test gist for PC documentation

Welcome Emails

  • Turn off the default MailChimp welcome email (if you haven't done so already) for the list.
  • Ensure every form that captures a new MailChimp subscriber includes the appropriate signup source.

Organic

Create a Welcome Message Automation Workflow with segmentation conditions set to the organic signup source(s). Note this may be a subset of signup sources (e.g. header, footer, popup, etc.) depending on what you are sending as a signup source. In this case add multiple segmentation conditions on Signup Source where subscribers match ANY (not ALL).

Promotions

@emilyemoss
emilyemoss / email_button
Created February 26, 2014 22:29
Email Button
<!--Button-->
<table border="0" align="left" cellpadding="0" cellspacing="0" bgcolor="#F7680A" style="border-radius: 4px; border-spacing: 0;">
<tr>
<td mc:edit="1:1 Article Button" align="center" style="border-collapse: collapse;"><a href="" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #ffffff; border: 10px solid #F7680A; padding-left: 5px; padding-right: 5px; border-radius: 4px; text-decoration: none; font-weight: bold;">Read More</a></td>
</tr>
</table>
<!--End Button-->
@emilyemoss
emilyemoss / tag_cleaner
Created October 18, 2013 19:25
Replace bad tags
def tag_cleaner(bad, good, list)
if list == "location"
array = Link.tagged_with(bad)
array.find_each do |l|
l.location_list.add(good)
l.location_list.remove(bad)
l.save
end
end
end
<!DOCTYPE html>
<html>
<head></head>
<body>
<p>Top Contributor</p>
<a href="http://informerly.com" target="_blank" title="Informerly" style="text-decoration: none;"><img src="http://i.imgur.com/9TgKsm1.png" alt="Informerly Top Contributor"></a>
<br>
<br>