Skip to content

Instantly share code, notes, and snippets.

Nested / Sub Dropdown Menu for Any Timberized Shopify theme

  1. Replace site-nav.liquid with the snippet below.
  2. Add the styles below to timber.scss.liquid.
  3. Go make popcorn.
  4. Check your homepage to see if this has worked.
  5. It didn't work.
  6. Eat the popcorn and try to figure out what went wrong.

Important

<script>
Shopify.queryParams = {};
if (location.search.length) {
for (var aKeyValue, i = 0, aCouples = location.search.substr(1).split('&'); i < aCouples.length; i++) {
aKeyValue = aCouples[i].split('=');
if (aKeyValue.length > 1) {
Shopify.queryParams[decodeURIComponent(aKeyValue[0])] = decodeURIComponent(aKeyValue[1]);
}
}
}
@dinhnguyen
dinhnguyen / time format
Last active August 29, 2015 14:21
time format
{
"current": {
"brand_type": "image",
"brand_text": "",
"min_height_logo": "131",
"show_header_search": true,
"search_placeholder": "search",
"display_social": true,
"facebook_link": "http://facebook.com/shopify",
"twitter_link": "http://twitter.com/shopify",
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
<script type="text/javascript">
// <![CDATA[
var selectCallback = function(variant, selector) {
if (variant && variant.available == true) {
// selected a valid variant
jQuery('.purchase').removeClass('disabled').removeAttr('disabled'); // remove unavailable class from add-to-cart button, and re-enable button
jQuery('.price-field').html(Bizweb.formatMoney(variant.price, "{{store.money_with_currency_format}}")); // update price field
} else {
// variant doesn't exist
/**** global css ****/
body{font-family:Arial, Helvetica, sans-serif;}
a {text-decoration:none; color:#5fa6d8;}
a:hover{color:#84ddf2;}
p{line-height:1.45em;}
.left{float: left;}
.right{float: right;}
@dinhnguyen
dinhnguyen / gist:035b7f07304b69125db5
Created July 30, 2015 01:57
Fixing xcrun: error: invalid active developer path (/usr/bin), missing xcrun at: /usr/bin/usr/bin/xcrun in OSX 10.9 Mavericks
Fixing xcrun: error: invalid active developer path (/usr/bin), missing xcrun at: /usr/bin/usr/bin/xcrun in OSX 10.9 Mavericks
When using git for the first time in OSX Mavericks you may run into a problem where you get the following error:
xcrun: error: invalid active developer path (/usr/bin), missing xcrun at: /usr/bin/usr/bin/xcrun
This error indicates can be fixed by running the following commands:
sudo xcode-select --install
@dinhnguyen
dinhnguyen / xxx
Created September 14, 2015 03:06
xxx
{% include 'breadcrumb' %}
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | product_img_url: 'grande' }}">
<meta itemprop="shop-currency" content="{{ shop.currency }}">
<section class="main-container col1-layout">
<div class="main container">
<div class="col-main">
<div class="row">
<div class="product-view">
{% include 'breadcrumb' %}
<div itemscope itemtype="http://schema.org/Product">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | product_img_url: 'grande' }}">
<meta itemprop="shop-currency" content="{{ shop.currency }}">
<section class="main-container col1-layout">
<div class="main container">
<div class="col-main">
<div class="row">
<div class="product-view">