Skip to content

Instantly share code, notes, and snippets.

@teckx5
teckx5 / gist:3f2935c2783858f5c8b6a84bf518d0f1
Created September 25, 2019 11:24 — forked from rameshanandakrishnan/gist:cea2ae42be7e01ed88f0
Shopify support multiple gift wrapping options - modified Caroline Schnapp's gift wrapper code
<!-- Add a flat charge per order -->
<!-- DO NOT REMOVE THE FOLLOWING COMMENT -->
<!-- (c) Copyright 2014 Caroline Hill. All Rights Reserved. Contact Mlle Caroline Schnapp at mllegeorgesand@gmail.com -->
<!-- DO NOT REMOVE THE ABOVE COMMENT -->
{% if linklists.gift-wrapping.links.size > 0 and linklists.gift-wrapping.links.first.type == 'product_link' %}
<div id="is-a-gift" class="clearfix rte">
{% for variant in linklists.gift-wrapping.links.first.object.variants %}
<p>
@teckx5
teckx5 / bootstrap-3-vert-offset-shim.css
Created October 3, 2016 15:53 — forked from erobert17/bootstrap-3-vert-offset-shim.css
Adds a vertical offset top and bottom to Bootstrap 3 to be used within columns. Currently no vertical offset is available as standard in Bootstrap 3.
/*
Include this after bootstrap.css. Add class of
vert-offset-top-value or vert-offset-bottom-value
to your Bootstrap 3 default rows to prevent row content
from touching the row content above or below.
*/
/* Vertical Offset Bottom */
.vert-offset-top-12{
margin-top: 12em;
@teckx5
teckx5 / Adding a search popup.md
Created May 26, 2016 01:04 — forked from kyledurand/Adding a search popup.md
Adding a search box popup / modal to the Brooklyn Theme

Issue

Brooklyn doesn't have a search box by default and adding one to the header somewhat disrupts the aesthetic of the theme. Instead of adding just an icon linking to the search page, why not adding a modal using the already built in popup plugin?

image

Did you see that fade in?! It's actually very smooth IRL.

Steps:

@teckx5
teckx5 / 1-instructions.md
Created May 26, 2016 01:03 — forked from kyledurand/1-instructions.md
[Supply] Sub Dropdown Menus

Nested / Sub Dropdown Menu for (Almost) Any Shopify theme Based off of Timber

  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

@teckx5
teckx5 / silder
Created April 18, 2016 13:35 — forked from LordZardeck/silder
Allows videos within a flexslider to stop the slider when playing, and continue the slider when done.
$(function() {
var slider, // Global slider value to force playing and pausing by direct access of the slider control
canSlide = true; // Global switch to monitor video state
// Load the YouTube API. For some reason it's required to load it like this
var tag = document.createElement('script');
tag.src = "//www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
{% if template contains 'product' %}
<script>
jQuery(function($) {
$('form[action="/cart/add"]').submit(function() {
var formIsValid = true;
var message = "Please fill this out and you will be able to add the item to your cart.";
$(this).find('[name^="properties"]').filter('.required, [required="required"]').each(function() {
$(this).removeClass('error');
if (formIsValid && $(this).val() == '') {
formIsValid = false;
@teckx5
teckx5 / Shopify Blog Display a Collection in a Blog
Created December 9, 2015 15:46 — forked from JamieS/Shopify Blog Display a Collection in a Blog
Shopify Blog Display a collection in a blog
<div class="article">
<h2 class="article-title">{{ article.title }}</h2>
<p class="article-details">posted <span class="article-time">{{ article.published_at | date: "%Y %h" }}</span> by <span class="article-author">{{ article.author }}</span></p>
<div class="article-body textile">
{{ article.content }}
{% if article.title == 'Our New merchandise' %}
<ul>
{% for product in collections.new-merchandise.products limit:3 %}
<li>
<div class="feature-product">
@teckx5
teckx5 / web.config
Created October 15, 2015 10:49 — forked from jonahvsweb/web.config
How to Setup WordPress Permalinks on Windows IIS ======================================= Place this file into the base directory of your WordPress installation to allow permalinks (or "pretty URLs") on Windows IIS.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
@teckx5
teckx5 / criticalcss-bookmarklet-devtool-snippet.js
Last active August 29, 2015 14:27 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@teckx5
teckx5 / gist:75db81c47d393f391b7f
Created June 29, 2015 19:36
Shopify Shipping Notification - For Pickup or Shipping
{% if shipping_method.title contains 'Pickup' %}
// Your Pickup Message, e.g. This email confirms that you picked up the following items from our store today. We appreciate your business. Come again soon. //
{% else %}
// Your standard shipping email message //
{% endif %}