Skip to content

Instantly share code, notes, and snippets.

View kellyvaughn's full-sized avatar
👀
lookin at ur code

Kelly Vaughn kellyvaughn

👀
lookin at ur code
View GitHub Profile
@kellyvaughn
kellyvaughn / custom-fees.liquid
Created December 3, 2016 21:09
(Shopify) Snippet to auto add product to cart based on Bold Product Options selection (one-time fee)
{% assign totes_addon = all_products['custom-tote-new-order-fee'] %}
{% assign pouches_addon = all_products['custom-pouches-new-order-fee'] %}
{% assign cards_addon = all_products['custom-cards-new-order-fee'] %}
{% unless cart.item_count == 0 %}
{% assign totes_id = totes_addon.variants.first.id %}
{% assign pouches_id = pouches_addon.variants.first.id %}
{% assign cards_id = cards_addon.variants.first.id %}
{
input: {
title: 'Allison Floral (Customized) Pocket Square',
bodyHtml: "<h3>Colors</h3>Lip Balm (#ec9a90, Knotty)<br>Cashew (#f4e4cb, Knotty)<br>Spruce (#768c7c, Knotty)<br>Cypress (#2f443b, Knotty)<br>High Tide (#032e45, Knotty)<br>Ruby (#752633, Knotty)<br><br> We recommend checking out our <a href='https://www.knottytie.com/products/colormatch-chart'>ColorMatch Chart</a> to verify your colors. Colors can vary from screen to print. If you want to guarantee your colors match what you are expecting, this is the best way to do it.",
vendor: 'Knotty Tie Co.',
templateSuffix: 'configured-pocket-square',
productType: 'Configured pocket square',
variants: [ { price: '20.00', options: [ '12" Square' ] } ],
options: [ 'Size' ],
tags: 'configured product, Recommendations disabled, Hidden recommendation',
@kellyvaughn
kellyvaughn / _quickview.scss.liquid
Last active September 6, 2023 08:06
Shopify Quick View
#quick-view {
display: flex;
height: 100%;
justify-content: flex-end;
flex-wrap: wrap;
position: relative;
-ms-overflow-style: -ms-autohiding-scrollbar;
.qv-product-images {
width: 60%;
height: auto;
@kellyvaughn
kellyvaughn / noodles.js
Created June 5, 2023 01:38
Accept LinkedIn Requests
const btns = document.querySelectorAll('button[aria-label*="Accept"]')
for(const btn of btns){
setTimeout(() => { btn.click() }, 300)
}
@kellyvaughn
kellyvaughn / js-variables.liquid
Created December 9, 2020 16:38
JS Variables
/* ===== JS-VARIABLES.LIQUID (snippets/js-variables.liquid)
======================= */
{% capture js_variables %}
Shopify = window.Shopify || {};
{% comment %} /* # Theme settings
================================================== */ {% endcomment %}
Shopify.theme_settings = {};
@kellyvaughn
kellyvaughn / shipping-bar.liquid
Created October 1, 2020 18:01
KellyxKelly - Shipping Bar
{% assign threshold = section.settings.free-shipping-threshold | times: 100 %}
{% assign amount_remaining = threshold | minus: cart.items_subtotal_price %}
{% assign amount_remaining_money = amount_remaining | money %}
<div class="shipping-bar">
{% if amount_remaining <= 0 %}
<p>{{ section.settings.free-shipping-message }}</p>
{% else %}
<p>{{ section.settings.approaching-message | replace: '*', amount_remaining_money }}</p>
{% endif %}
@kellyvaughn
kellyvaughn / graphql-using-vanilla-js.js
Last active January 11, 2022 23:12
Shopify GraphQL Storefront API using Vanilla JavaScript
// This example was used to pull in variant titles and IDs dynamically
// on a custom build of the ReCharge customer portal.
//
// Feel free to send me an email if you have any questions.
//
// Kelly Vaughn -- The Taproom Agency
// kelly@thetaproom.com
// 1. Retrieve product ID in any format
const productId = <pathToProductId>;
@kellyvaughn
kellyvaughn / shopifybreadcrumb.txt
Created October 13, 2015 20:34
Shopify Product Breadcrumb (Home > Category > Subcategory > Product)
<span aria-hidden="true">&rsaquo;</span>
{% if current_tags %}
{% capture url %}/collections/{{ collection.handle }}{% endcapture %}
{{ collection.title | link_to: url }}
<span aria-hidden="true">&rsaquo;</span>
<span>{{ current_tags | join: " + " | replace: 'custom', 'Custom Built by Midwestern Craftsman' | replace: 'chalk/clay paint', 'Junk Gypsy™ Chalk/Clay Paint' | replace: "Milk Paint", "Miss Mustard Seed's Milk Paint" }}</span>
{% else %}
<span>{{ collection.title }}</span>
{% endif %}
<span aria-hidden="true">&rsaquo;</span>
@kellyvaughn
kellyvaughn / index-hero.liquid
Created September 13, 2019 17:56
Hero Video (with fallback image)
<div class="video-holder">
<video autoplay muted loop playsinline poster="{{ section.settings.image | img_url: '2000x', scale: 2 }}">
{% unless section.settings.video-mp4 == blank %}<source src="{{ section.settings.video-mp4 }}" type="video/mp4" />{% endunless %}
{% unless section.settings.video-ogg == blank %}<source src="{{ section.settings.video-ogg }}" type="video/ogg" />{% endunless %}
<img src="{{ section.settings.image | img_url: '2000x', scale: 2 }}" />
</video>
</div>
<div class="overlay"></div>
<div class="hero-content">
@kellyvaughn
kellyvaughn / gist:b22c3f8f2d4f28264a44eac5ad632594
Created October 27, 2017 14:59
Order confirmation email: See lines 196-204
{% capture email_title %}Thank you for your purchase! {% endcapture %}
{% capture email_body %}
{% if requires_shipping %}
Hi {{ customer.first_name }}, we're getting your order ready to be shipped. We will notify you when it has been sent.
{% endif %}
{% endcapture %}
<!DOCTYPE html>
<html lang="en">
<head>