Skip to content

Instantly share code, notes, and snippets.

View cargix1's full-sized avatar

Andrew Cargill cargix1

View GitHub Profile
@cargix1
cargix1 / gist:e7f04214915383c9e198
Last active September 11, 2015 22:59
Filter for select fields using Vue.js. You can call
# Add the following to your app.js file.
Vue.filter('extract', function (values, option_value, option_label) {
var response = [];
values.forEach(function (value) {
response.push({
text: value[option_label],
{% if template contains 'cart' %}
<script type="text/javascript">
$(document).ready(function() {
$("[name='checkout']").on("click", function() {
var date = $(".zapietCollectionDate").val();
var locationId = $(".clickCollectLocation").val();
if(locationId != 'none') {
if(date == '') {
{% if template contains 'cart' %}
<script type="text/javascript">
$(document).ready(function() {
$("[name='checkout']").on("click", function() {
var date = $(".zapietCollectionDate").val();
if(date == '') {
alert('Please select a date and time.');
return false;
}
@cargix1
cargix1 / gist:8b355458278b0a948646
Created October 13, 2015 20:58
Default New Order Notification
<p>Hello {{ shop_name }},</p>
<p></p>
<p>{% if customer.name %}{{ customer.name }}{% else %}Someone{% endif %} placed a new order with your store, {{ date | date: "%b %d %I:%M%p" }}:</p>
<p></p>
<ul> {% for line in line_items %} <li> <img src="{{ line | img_url: 'thumb' }}" /> {{ line.quantity }}x {{ line.title }} for {{ line.price | money }} each </li> {% endfor %} </ul>
<a href="https://{{ shop.permanent_domain }}/admin/orders/{{ id }}">View order {{order_name}} </a>
{% if fulfillment_aborted %}
<p>The above order was not automatically fulfilled because it was flagged as suspicious.</p>{% endif %}
<p></p><br>
{% if has_high_risks? %}<p><b>Security check:</b></p>
@cargix1
cargix1 / shopify-countries-counties-list.json
Created October 14, 2015 09:45
Shopify Countries/Counties list
{
"Canada": {
"label": "Province",
"zip_label": "Postal code",
"zip_placeholder": "Postal code",
"zip_required": true,
"province_label": "Province",
"provinces": [
"Alberta",
"British Columbia",
@cargix1
cargix1 / gist:2b4957ac5d049482cb69
Created October 10, 2015 11:00
Default Order Confirmation Template
<p>Thank you for placing your order with {{ shop_name }}!</p>
<p>This email is to confirm your recent order.</p>
<p>Date {{ date | date: "%m/%d/%Y" }}</p>
{% if requires_shipping and shipping_address %}
<p><b>{% if attributes.Store-Pickup-Order == "Yes" %}Pickup location{% else %}Shipping address{% endif %}</b><br />
{% if attributes.Store-Pickup-Order == "Yes" %}{{ shipping_address.company }}{% else %}{{ shipping_address.name }}{% endif %}<br />
{{ shipping_address.street }}<br />
{{ shipping_address.city }}<br />
{{ shipping_address.province }}
{{ shipping_address.zip }}<br />
@cargix1
cargix1 / gist:0039565fd832ac5c4dcd
Created September 23, 2015 16:35
Datepicker validation when using ajax cart
1). Add the following code towards the bottom of your theme.liquid file. Ensure it's above the code shown in step 2.
<script>
function checkDateTime() {
$("[name='checkout']").on("click", function() {
var date = $(".zapietCollectionDate").val();
var locationId = $(".clickCollectLocation").val();
@cargix1
cargix1 / order-confirmation-v2.0.liquid
Last active February 28, 2016 13:12
Order Confirmation v2.0
<p>Thank you for placing your order with {{ shop_name }}!</p>
<p>This email is to confirm your recent order.</p>
<p>Date {{ date | date: "%m/%d/%Y" }}</p>
{% if requires_shipping and shipping_address %}
<p><b>{% if attributes.Checkout-Method == "pickup" %}Pickup location{% elsif attributes.Checkout-Method == "delivery" %}Delivery address{% else %}Shipping address{% endif %}</b><br />
{% if attributes.Checkout-Method == "pickup" %}
{{ shipping_address.company }}<br />
{% else %}
{{ shipping_address.name }}<br />
{% endif %}
@cargix1
cargix1 / Shipping confirmation
Last active March 7, 2016 10:36
Shipping confirmation email template
{% if billing_address.name %}
<p>Dear {{ billing_address.name }},</p>
<p></p>
{% endif %}
{% if attributes.Checkout-Method == "pickup" %}
<p>{% if fulfillment.item_count == item_count %}All{% elsif fulfillment_status == 'fulfilled' %}The last{% else %}Some{% endif %} of the items from order {{ name }} are now ready for pickup from:</p>
<p>{{ shipping_address.company }}<br />
{% if fulfillment.fulfillment_line_items.count == item_count %}
{% capture shipment_name %}Your order is{% endcapture %}
{% elsif fulfillment.item_count > 1 %}
{% if fulfillment_status == 'fulfilled' %}
{% capture shipment_name %}The last items in your order are{% endcapture %}
{% else %}
{% capture shipment_name %}Some items in your order are{% endcapture %}
{% endif %}
{% else %}
{% if fulfillment_status == 'fulfilled' %}