This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Place this in your product.liquid template, either at the top or bottom. | |
{% endcomment %} | |
{% if product.variants.size > 1 %} | |
<script> | |
(function($) { | |
var variantImages = {}, | |
thumbnails, | |
variants = {}; | |
{% for variant in product.variants %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Source: https://gist.github.com/carolineschnapp/9122054 | |
If you are not on a collection page, do define which collection to use in the order form. | |
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle. | |
{% assign collection = collections.your-collection-handle-here %} | |
Use the assign statement outside of this comment block at the top of your template. | |
{% endcomment %} | |
{% paginate collection.products by 100 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign choices = "Facebook, Twitter, Google, Best Toys Bulletin, John Doe" %} | |
{% assign required = true %} | |
<div class="form-vertical"> | |
<p> | |
<label for="how-did-you-hear-about-us">How did you hear about us?</label> | |
<select id="how-did-you-hear-about-us" name="attributes[how-did-you-hear-about-us]"> | |
<option value=""{% if cart.attributes.how-did-you-hear-about-us == "" %} selected{% endif %}>Please make a selection</option> | |
{% assign optionsArray = choices | split: ',' %} | |
{% for o in optionsArray %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if cart.item_count > 0 %} | |
<script> | |
// Script that updates images on the cart page to show the correct thumbnail as chosen in the Variant Images app. | |
// This works with any markup. | |
// This works when using Line Item Properties where several items in the cart form can share the same variant ID. | |
// Author: Caroline Schnapp. | |
// Place at the top of your cart.liquid template. | |
(function($) { | |
var variantImages = {}, | |
productHandles = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="collection"> | |
{% paginate collection.products by 25 %} | |
<div class="row"> | |
<div class="span10 products"> | |
<div class="row"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="collection"> | |
{% paginate collection.products by 18 %} | |
<div class="row"> | |
<div class="span9 products"> | |
<div class="row"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Desktop/{query} | |
rm config.yml | |
find . -name '*.DS_Store' -type f -delete | |
rm .gitignore | |
rm -rf .git | |
rm -rf less | |
cd .. | |
zip -r {query} {query} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move to some folder where you want to download your theme. | |
Go to your shop admin. | |
Go to /admin/api | |
Copy this: | |
API Key | |
Password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- It is important to understand that SwiftType uses Shopify's robots.txt to know which pages to crawl for suggestions. | |
So it will look at 'page' pages, blog pages, collection pages and product pages. | |
It will also crawl the home page and /serach page unless those are deleted in the SwiftType account under Pages. | |
It will look at collection-agnostic product URLs, because that's what robots.txt tells it to do. | |
So no collection-aware product pages will be crawled. --> | |
<!-- Other important consideration: as title for the suggestion, SwiftType uses the content of the title tag, or any h1 or h2 tags, on the page. | |
For most searches, the content title will show up nicely: product title if searching for a product, collection title if searching for a collection, etc. | |
Since Shopify 2, one can set up a SEO title for each product, and we don't want it to come up, so we can force a few things for product pages: | |
product title, also add vendor name, product type, product tags, and product image...--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign has_color = false %} | |
{% assign option_index = 0 %} | |
{% for option in product.options %} | |
{% capture downcased_option %}{{ option | downcase }}{% endcapture %} | |
{% if downcased_option contains 'color' or downcased_option contains 'colour' %} | |
{% assign option_index = forloop.index0 %} | |
{% assign has_color = true %} | |
{% endif %} | |
{% endfor %} | |
{% if has_color %} |