Skip to content

Instantly share code, notes, and snippets.

View whistlerbrad's full-sized avatar

Brad whistlerbrad

View GitHub Profile
@whistlerbrad
whistlerbrad / Link product options
Created August 15, 2017 00:23
shop.js extra code to support Link product options
<!-- /templates/page.contact-custom.liquid -->
<div class="wrapper page-margin" data-section-id="{{ section.id }}">
<div class="grid">
<div class="grid__item large--two-thirds push--large--one-sixth">
<h1 class="text-center h2">{{ page.title }}</h1>
{%- if section.settings.page_position == 'none' -%}
<div class="product-section" id="ProductSection-{{ section.id }}" data-section-id="{{ section.id }}" data-section-type="product" data-image-zoom-enable="{{ section.settings.zoom_enable }}">
<div itemscope itemtype="http://schema.org/Product" class="product-page">
<div class="wrapper">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
{% if section.settings.product_breadcrumbs %}
{% include 'breadcrumb' %}
@whistlerbrad
whistlerbrad / collection-sorting.liquid
Created September 21, 2017 20:53
Fixed sort but for titles with spaces
<!-- /snippets/collection-sorting.liquid -->
<div class="form-horizontal">
<label for="SortBy" class="uppercase">{{ 'collections.sorting.title' | t }}&nbsp;</label>
<select name="SortBy" id="SortBy">
<option value="manual">{{ 'collections.sorting.featured' | t }}</option>
<option value="best-selling">{{ 'collections.sorting.best_selling' | t }}</option>
<option value="title-ascending">{{ 'collections.sorting.az' | t }}</option>
<option value="title-descending">{{ 'collections.sorting.za' | t }}</option>
<option value="price-ascending">{{ 'collections.sorting.price_ascending' | t }}</option>
<option value="price-descending">{{ 'collections.sorting.price_descending' | t }}</option>
@whistlerbrad
whistlerbrad / nav-contents.liquid
Created September 22, 2017 22:28
Wholesale Nav support
<div class="mobile-wrapper">
<div class="header-cart__wrapper">
<a href="/cart" class="CartToggle header-cart"></a>
<span class="header-cart__bubble cartCount{% if cart.item_count < 1 %} hidden-count{% endif %}"></span>
</div>
<div class="logo-wrapper{% if section.settings.logo %} logo-wrapper--image{% endif %}">
{% if template == 'index' %}
<h1 class="h4 header-logo" itemscope itemtype="http://schema.org/Organization">
{% else %}
<div class="h4 header-logo" itemscope itemtype="http://schema.org/Organization">
@whistlerbrad
whistlerbrad / product-no-price
Last active December 18, 2017 21:22
Liquid file for 1.6
<!-- /snippets/product-no-price.liquid -->
<div itemscope itemtype="http://schema.org/Product" class="product-page">
<div class="wrapper">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
<meta itemprop="price" content="{{ product.price | money }}">
{% if settings.product_breadcrumbs %}
@whistlerbrad
whistlerbrad / collection-custom-center-center
Last active October 11, 2017 19:54
Title and description below image
<!-- /sections/collection-custom-center-center.liquid -->
{%- assign grid_offset = '' -%}
{%- assign products_count = collection.products_count -%}
{%- case section.settings.grid_setting_large -%}
{%- when 1 -%}
{%- assign grid_width_large = 'large--one-whole' -%}
{%- when 2 -%}
{%- assign grid_width_large = 'large--one-half' -%}
{%- if products_count == 1 -%}
@whistlerbrad
whistlerbrad / collection-custom-center
Created September 26, 2017 01:12
Title in image description center below image
<!-- /sections/collection-custom-center.liquid -->
{%- assign grid_offset = '' -%}
{%- assign products_count = collection.products_count -%}
{%- case section.settings.grid_setting_large -%}
{%- when 1 -%}
{%- assign grid_width_large = 'large--one-whole' -%}
{%- when 2 -%}
{%- assign grid_width_large = 'large--one-half' -%}
{%- if products_count == 1 -%}
@whistlerbrad
whistlerbrad / collection-custom-left
Created September 26, 2017 01:16
Title in image, description below left aligned
<!-- /sections/collection-custom-left.liquid -->
{%- assign grid_offset = '' -%}
{%- assign products_count = collection.products_count -%}
{%- case section.settings.grid_setting_large -%}
{%- when 1 -%}
{%- assign grid_width_large = 'large--one-whole' -%}
{%- when 2 -%}
{%- assign grid_width_large = 'large--one-half' -%}
{%- if products_count == 1 -%}
@whistlerbrad
whistlerbrad / index-double
Created September 27, 2017 00:43
For older Pipeline users
{% assign blockList = '' %}
{% for block in section.blocks %}
{% assign blockList = blockList | append: block.type | append:',' %}
{% endfor %}
{% assign blockArray = blockList | split: "," %}
{% assign swaparoo = false %}
{% if blockArray[0] != 'image' and blockArray[1] == 'image' %}
{% assign swaparoo = true %}
{% endif %}