Skip to content

Instantly share code, notes, and snippets.

View carolineschnapp's full-sized avatar

Caroline carolineschnapp

  • Shopify
  • Montreal
View GitHub Profile
# This file is auto-generated from the current state of the database. Instead of editing this file,
# please use the migrations feature of Active Record to incrementally modify your database, and
# then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
# to create the application database on another system, you should be using db:schema:load, not running
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
class LoginController < ApplicationController
def index
# Ask user for their #{shop}.myshopify.com address
end
def authenticate
redirect_to ShopifyAPI::Session.new(params[:shop].chomp('/')).create_permission_url
end
# Shopify redirects the logged-in user back to this action along with
class LoginController < ApplicationController
def index
# Ask user for their #{shop}.myshopify.com address
end
def authenticate
redirect_to ShopifyAPI::Session.new(params[:shop].chomp('/')).create_permission_url
end
# Shopify redirects the logged-in user back to this action along with
class LoginController < ApplicationController
def index
# Ask user for their #{shop}.myshopify.com address
end
def authenticate
redirect_to ShopifyAPI::Session.new(params[:shop].chomp('/')).create_permission_url
end
# Shopify redirects the logged-in user back to this action along with
@carolineschnapp
carolineschnapp / product.liquid.html
Created April 8, 2010 17:04
Hiding the Default variant drop-down in Vogue
<div id="product-left">{% for image in product.images %}{% if forloop.first %}
<div id="product-image">
<a href="{{ image | product_img_url: 'large' }}" rel="lightbox[images]" title="{{ product.title | escape }}"><img src="{{ image | product_img_url: 'medium' }}" alt="{{ product.title | escape }}" /></a>
</div>{% else %}
<div class="product-images">
<a href="{{ image | product_img_url: 'large' }}" rel="lightbox[images]" title="{{ product.title | escape }}"><img src="{{ image | product_img_url: 'small' }}" alt="{{ product.title | escape }}" /></a>
</div>{% endif %}{% endfor %}
</div>
<div id="product-right">
<h1>{{ product.title }}</h1>
@carolineschnapp
carolineschnapp / product.liquid.html
Created April 8, 2010 17:52
Hiding 'Default' drop-down in Reconfigured
<h1>
{{ product.title }}
{% for variant in product.variants %}
{% if variant.available %}
{% else %}
<span class="soldout"><em>{{ variant.title }}</em> is currently Sold Out! :(</span>
{% endif %}
{% endfor %}
</h1>
<!--product-block-->
@carolineschnapp
carolineschnapp / gist:360333
Created April 8, 2010 17:55
Product.liquid template that hides the drop-down when there's only 1 variant for Moderno
<div id="product-left">
<h2>{{ product.title }} by {{ product.vendor }} <span>{{ product.price | money }}</span></h2>
{{ product.description }}
<div id="product-select">
<form action="/cart/add" method="post" name="cartadd">
{% if product.available %}
<div id="product-variants">
{% if product.variants.size == 1 %}
<fieldset>
<legend>Site Title</legend>
<table>
<tr>
<th><label for="title_width">Title Size</label></th>
<td>
<select name="title_width" id="title_width">
<option value="normal" selected="selected">Normal (147 x 167 px)</option>
<option value="wide">Wide (294 x 167 px)</option>
</select>
@carolineschnapp
carolineschnapp / gist:426020
Created June 4, 2010 22:22
related-by-tags.liquid (snippet for Solo theme)
{% if product.tags.size > 0 %}
<!-- START RELATED -->
<div id="related">
<h6>{% if settings.related.size > 0 %}{{ settings.related | escape }}{% else %}Take a look at these great accessories:{% endif %}</h6>
<!-- START SLIDER -->
<div id="slider" class="clear">
<!-- START PREV -->
<div id="prev">
<p><a href="/collections/all" class="inactive">Previous</a></p>
</div>
class HomeController < ApplicationController
around_filter :shopify_session, :except => 'welcome'
def welcome
current_host = "#{request.host}#{':' + request.port.to_s if request.port != 80}"
@callback_url = "http://#{current_host}/login/finalize"
end
def index