Skip to content

Instantly share code, notes, and snippets.

@zorzv
zorzv / Email Cart POS
Created September 8, 2021 12:54
Shopify Email Cart POS with Line Properties
{% capture email_title %}Are you ready to complete your order?{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
<style>
@zorzv
zorzv / Draft order invoice
Created September 8, 2021 12:53
Shopify draft order invoice with line properties
{% capture email_title %}Complete your purchase{% endcapture %}
{% capture email_body %}
{% if item_count > 1 %}
These items will be reserved for you until: <strong>{{ reserve_inventory_until | date: format: 'default' }}</strong>
{% else %}
This item will be reserved for you until: <strong>{{ reserve_inventory_until | date: format: 'default' }}</strong>
{% endif %}
{% endcapture %}
<!DOCTYPE html>
@zorzv
zorzv / Order refund
Created September 8, 2021 12:52
Shopify order refund with Line Properties
{% if refund_line_items.size == item_count %}
{% capture email_title %}Your order has been refunded{% endcapture %}
{% elsif refund_line_items.size == 0 %}
{% capture email_title %}You have received a refund{% endcapture %}
{% else %}
{% capture email_title %}Some items in your order have been refunded{% endcapture %}
{% endif %}
{% capture email_body %}Total amount refunded: <strong>{{ amount | money_with_currency }}</strong>{% endcapture %}
<!DOCTYPE html>
@zorzv
zorzv / Order canceled
Created September 8, 2021 12:52
Shopify order canceled with Line Properties
{% capture email_title %}Your order has been canceled{% endcapture %}
{% capture email_body %}
{% if financial_status == 'voided' %}
{% case cancel_reason %}
{% when 'customer' %}
Order {{ name }} was canceled at your request and your payment has been voided
{% when 'inventory' %}
Order {{ name }} was canceled because we did not have enough stock to fulfill your order and your payment has been voided
{% when 'fraud' %}
Order {{ name }} was canceled because we suspect it is fraudulent and your payment has been voided
@zorzv
zorzv / Order invoice
Created September 8, 2021 12:51
Shopify Order invoice with Line Properties
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
<style>
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
@zorzv
zorzv / Order edited invoice
Created September 8, 2021 12:50
Shopify Order edited invoice with Line Properties
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
<style>
.button__cell { background: {{ shop.email_accent_color }}; }
a, a:hover, a:active, a:visited { color: {{ shop.email_accent_color }}; }
@zorzv
zorzv / Order Edited
Created September 8, 2021 12:50
Shopify Order Edited with Line Properties
{% capture email_title %}Your order was updated {% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ email_title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="/assets/notifications/styles.css">
<style>
.button__cell { background: {{ shop.email_accent_color }}; }
@zorzv
zorzv / Order Confirmation
Created September 8, 2021 12:38
Shopify Order Confirmation with Line Properties
{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
{% case delivery_method %}
{% when 'pick-up' %}
You’ll receive an email when your order is ready for pickup.
{% when 'local' %}
Hi {{ customer.first_name }}, we're getting your order ready for delivery.
{% else %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
@zorzv
zorzv / ld-auto-mark-complete.php
Created August 17, 2021 12:26 — forked from weismannweb/ld-auto-mark-complete.php
Auto complete learndash topics and lessons
//thanks to https://gist.github.com/sultann/24baa5483b4632c3cf214a8de5648204#file-ld-auto-mark-complete-php-L17 for most of
//this code, i just corrected it to work with ld_lesson_tag to grab the tags as the original version returned empty
//array since it was looking for standard wp tags
function ld_is_tagged($postId) {
//get all learndash tags on post
$tags = wp_get_post_terms($postId,'ld_lesson_tag');
foreach ($tags as $tag) {
//need to check for auto-mark-complete tag exists on this post
@zorzv
zorzv / footer.liquid
Created August 17, 2021 12:14
Modify Powered by Shopify text in footer.liquid