Skip to content

Instantly share code, notes, and snippets.

View whistlerbrad's full-sized avatar

Brad whistlerbrad

View GitHub Profile
@whistlerbrad
whistlerbrad / product-grid-item.liquid
Created November 8, 2017 04:13
Collection grid Buy Now button on hover instead of price
{%- assign product_img_url = product.featured_image.src | img_url: '700x' -%}
{%- if grid_width_large == 'large--one-whole' -%}
{%- assign product_img_url = product.featured_image.src | img_url: '1200x' -%}
{%- elsif grid_width_large == 'large--one-half' -%}
{%- assign product_img_url = product.featured_image.src | img_url: '900x' -%}
{%- endif -%}
{%- assign on_sale = false -%}
{%- if product.compare_at_price > product.price -%}
{%- assign on_sale = true -%}
@whistlerbrad
whistlerbrad / article.liquid
Created January 6, 2018 07:15
Custom page in blog sidebar - Top of sidebar above tags
<!-- /sections/article.liquid -->
{% assign number_of_comments = article.comments_count %}
{% comment %}
If a comment was just submitted and it has no blank fields, we have an extra comment to count.
{% endcomment %}
{% if comment and comment.created_at %}
{% assign number_of_comments = article.comments_count | plus: 1 %}
{% endif %}
@whistlerbrad
whistlerbrad / footer.liquid
Created February 16, 2018 23:38
Original 3.1
@whistlerbrad
whistlerbrad / instagram-js
Created February 26, 2018 03:01
fix for IG token restrictions
theme.Instagram = (function() {
function Instagram(container) {
var $container = this.$container = $(container);
var id = $container.attr('data-section-id');
var instafeedEl = this.instagram = $('#Instafeed-' + id);
var instafeedId = this.instagram = 'Instafeed-' + id;
var apiSuccess = 0;
var imageLimit = instafeedEl.attr('data-count');
@whistlerbrad
whistlerbrad / snippets-product.liquid
Created March 12, 2018 04:46
Custom version to bring back Pipeline 2 product description drop-down options
<!-- /snippets/product.liquid -->
{% if product.template_suffix contains "charge-rabbit" %}
{% assign form_action = product.metafields.charge_rabbit.subscribe_path %}
{% assign form_method = 'get'%}
{% assign form_class = "charge-rabbit-product" %}
{% assign include_customer_id = true %}
{% assign membership_product = true %}
{% else %}
{% assign form_action = '/cart/add' %}
{% assign form_method = 'post'%}
@whistlerbrad
whistlerbrad / page-collection-1
Last active October 7, 2019 20:58
Tutorial multiple collections on one page
{%- assign collection = collections[section.settings.collection] -%}
{% case section.settings.grid %}
{% when 1 %}
{% assign grid_width_large = 'large--one-third push--large--one-third clear' %}
{% assign grid_width_medium = 'medium--one-half push--medium--one-quarter clear' %}
{% assign grid_width_small = 'small--one-whole' %}
{% when 2 %}
{% assign grid_width_large = 'large--one-half' %}
{% assign grid_width_medium = 'medium--one-half' %}
@whistlerbrad
whistlerbrad / index-collection-grid.liquid
Created April 13, 2018 00:05
Custom with optional image and link - Pipeline 3.1
{%- assign collection_image_size = 'x630' -%}
{%- assign grid_item_width = 'large--one-half' -%}
{% case section.settings.grid %}
{% when 1 %}
{%- assign grid_item_width = 'large--one-half collection-grid--single' -%}
{%- assign collection_image_size = 'x630' -%}
{% when 2 %}
{%- assign grid_item_width = 'large--one-half' -%}
{%- assign collection_image_size = 'x630' -%}
@whistlerbrad
whistlerbrad / settings_data.json
Last active May 5, 2018 04:36
Pipeline 4 Surf JSON
{
"current": {
"color_account_bg": "#dddddd",
"color_account_text": "#2e3344",
"color_header_bg": "#ffffff",
"color_header_text": "#2e3438",
"color_body_bg": "#ffffff",
"color_body_text": "#656565",
"color_primary": "#1990c6",
"color_splash": "#f4a482",
@whistlerbrad
whistlerbrad / settings_data.json
Last active May 4, 2018 22:15
Pipeline 4 basic JSON
{
"current": {
"color_account_bg": "#dddddd",
"color_account_text": "#2e3344",
"color_header_bg": "#ffffff",
"color_header_text": "#2e3438",
"color_body_bg": "#ffffff",
"color_body_text": "#656565",
"color_primary": "#1990c6",
"color_splash": "#f4a482",
@whistlerbrad
whistlerbrad / settings_data.json
Created May 4, 2018 22:17
Pipeline 3.1 basic JSON
{
"current": {
"color_account_bg": "#f3f3f3",
"color_account_text": "#656565",
"color_header_bg": "#ffffff",
"color_header_text": "#656565",
"color_body_bg": "#ffffff",
"color_body_text": "#656565",
"color_primary": "#585e71",
"color_splash": "#f4a482",