Skip to content

Instantly share code, notes, and snippets.

View carolineschnapp's full-sized avatar

Caroline carolineschnapp

  • Shopify
  • Montreal
View GitHub Profile
@carolineschnapp
carolineschnapp / collection-listing-using-linklist.liquid
Created August 13, 2010 19:48
Listing all collections in the shop
@carolineschnapp
carolineschnapp / product.liquid.html
Created October 23, 2010 22:09
product.liquid that does not show a drop-down when there's only 1 variant in WooStore (plus bug fixes)
<div id="main" class="col-left">
{% include 'breadcrumb-navigation' %}
<div class="fix"></div>
<div id="single-product" class="{{ product.handle }} post type-post">
<div class="col-left">
<a href="{{ product.featured_image | product_img_url: 'grande' }}" rel="{{ product.handle }}" class="preview">
@carolineschnapp
carolineschnapp / settings.html
Last active January 19, 2023 13:01
Additional settings for multiple currencies support
<fieldset>
<legend>Money options</legend>
<table>
<tr>
<td><label for="show_multiple_currencies">Show currency selector?</label></td>
<td><input type="checkbox" id="show_multiple_currencies" name="show_multiple_currencies" checked="checked" /></td>
</tr>
<tr>
<td colspan="2"><small>Although you will be able to display prices on your store front in different currencies, Shopify will still process orders in your shop's currency.</small></td>
</tr>
@carolineschnapp
carolineschnapp / currencies.liquid
Last active February 20, 2023 23:19
currencies.liquid
{% if settings.show_multiple_currencies %}
{{ "//cdn.shopify.com/s/javascripts/currencies.js" | script_tag }}
{{ "jquery.currencies.min.js" | asset_url | script_tag }}
<script>
Currency.format = '{{ settings.currency_format | default: 'money_with_currency_format' }}';
var shopCurrency = '{{ shop.currency }}';
@carolineschnapp
carolineschnapp / gist:773649
Last active August 21, 2019 13:17
currency-picker.liquid
<label class="currency-picker__wrapper">
<span class="currency-picker__label">Pick a currency</span>
<select class="currency-picker" name="currencies" style="display: inline; width: auto; vertical-align: inherit;">
{% assign codes = 'USD,EUR,GBP,CAD,ARS,AUD,BBD,BDT,BSD,BHD,BRL,BOB,BND,BGN,ILS,MMK,KYD,CLP,CNY,COP,CRC,HRK,CZK,DKK,DOP,XCD,EGP,XPF,FJD,GHS,GTQ,GYD,GEL,HKD,HUF,ISK,INR,IDR,NIS,JMD,JPY,JOD,KZT,KES,KWD,LVL,LTL,MXN,MYR,MUR,MDL,MAD,MNT,MZN,ANG,NZD,NGN,NOK,OMR,PKR,PYG,PEN,PHP,PLN,QAR,RON,RUB,SAR,RSD,SCR,SGD,SYP,ZAR,KRW,LKR,SEK,CHF,TWD,THB,TZS,TTD,TRY,UAH,AED,UYU,VEB,VND,ZMK' | split: ',' %}
{% assign supported_codes = settings.supported_currencies | split: ' ' %}
<option value="{{ shop.currency }}" selected="selected">{{ shop.currency }}</option>
{% for code in supported_codes %}
{% if code != shop.currency and codes contains code %}
<option value="{{ code }}">{{ code }}</option>
{% endif %}
@carolineschnapp
carolineschnapp / google_translate.html
Created February 1, 2011 19:27
Google Translate Embed Code
<div id="google_translate_element"></div>
<script>
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en'
}, 'google_translate_element');
}
</script>
<script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
@carolineschnapp
carolineschnapp / gist:833245
Created February 18, 2011 04:14
quantity.liquid for tiered-pricing
{% comment %}
Here you ignore products that don't have exactly the number of variants you use for your
tiered-priced products. Edit that number if your tiered-price products have more than 3 variants.
{% endcomment %}
{% if item.product.variants.size == 3 %}
{% assign found_variant = false %}
{% assign index = 1 %}
{% comment %}Determining if our item is the 1st, 2nd or 3rd variant of its product.{% endcomment %}
@carolineschnapp
carolineschnapp / product.liquid
Created March 4, 2011 02:24
Woodland product template that shows the compare at price
<style type="text/css">
del { font-size: 70%; color: #777 }
.disabled { -moz-opacity:0.50;opacity:.50;filter:alpha(opacity=50);cursor:default }
input[type="submit"].disabled:hover { background: {{ settings.button_color }} }
</style>
<div class="col-5 product">
<h2>{{ product.title | escape }}</h2>
{{ product.description }}
@carolineschnapp
carolineschnapp / login_controller.rb
Created May 1, 2011 18:47
Remember requested URL when logging in
class LoginController < ApplicationController
def index
# Ask user for their #{shop}.myshopify.com address
# If the #{shop}.myshopify.com address is already provided in the URL, just skip to #authenticate
if params[:shop].present?
# Added next line — Caroline.
session[:return_to] = request.path
# End of Caroline's addition.
redirect_to :controller => 'login', :action => "authenticate", :shop => params[:shop]
@carolineschnapp
carolineschnapp / cancellation.liquid
Created May 3, 2011 20:45
Order Cancellation Template
Dear {{ billing_address.name }},
Your order {{ name }} was cancelled {% case cancel_reason %}{% when 'customer' %}at your request.{% when 'inventory' %}because we did not have enough stock to fulfill your order.{% when 'fraud' %}because we suspect it is fraudulent.{% when 'other' %}due to unforseen circumstances.{% endcase %}
{% if financial_status == 'voided' %}Your payment has been voided.{% elsif financial_status == 'credited' %}Your payment has been refunded.{% endif %}
Please reply to this email if you have any questions or concerns.