Skip to content

Instantly share code, notes, and snippets.

View dav11d's full-sized avatar

David dav11d

  • UK
View GitHub Profile
const sanityClient = require('@sanity/client');
const crypto = require('crypto');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
SHOPIFY_SECRET
} = process.env;
@james-zedd
james-zedd / index--flickity-products.liquid
Last active February 1, 2023 15:52
Shopify Index Section -- Flickity Product Slider
{% comment %}
* Make sure you have the Flickity plugin installed and the proper license for this to function on your store
* Plugin, licensing and documentation at https://flickity.metafizzy.co/
{% endcomment %}
{% assign cell_align = section.settings.cell_align %}
{% assign wrap_around = section.settings.wrap_around %}
{% assign img_width = section.settings.img_width | append: 'x' %}
<div class="flickity-section-{{ section.id }} flickity-index-slider product" style="background-color: {{ section.settings.bg }}">
@dturton
dturton / gift-modal.md
Created May 12, 2018 13:55 — forked from jgodson/gift-modal.md
Free Gift Modal for Shopify Themes

How to install

  1. Copy the following code and paste it at the end of config/settings_schema.json, just after the last }. Then save the file.
,
  {
    "name": "Free Gift Offer",
    "settings": [
      {
        "type": "header",
        "content": "Offer a free gift with discount code on cart page"
@gregnb
gregnb / css-fadeup.html
Created June 12, 2017 21:37
CSS stagger fade up animation
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS Staggered fade up effect</title>
</head>
<script type="application/javascript">
</script>
@elmahdim
elmahdim / toggleClass.js
Created December 30, 2015 13:51
vanilla javascript toggleClass
function toggleClass(element, className) {
if (!element || !className) { return; }
var classString = element.className, nameIndex = classString.indexOf(className);
if (nameIndex == -1) {
classString += (classString.length) ? ' ' + className : className;
} else {
classString = classString.replace(' '+className, '');
classString = classString.replace(className, '');
}
element.className = classString;
@carolineschnapp
carolineschnapp / instructions.md
Last active June 21, 2021 20:39
Handpick your relevant collection for related products using the Custom Fields extension by freakdesign. #metafields
@paulirish
paulirish / bling.js
Last active August 27, 2024 04:55
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@schmoove
schmoove / jquery.shopify-ajax-cart.js
Last active February 1, 2023 17:41
A handy jQuery plugin for updating the Shopify Cart via their AJAX API
/*
* Project: Shopify AJAX Cart Plugin
* Description: Provides AJAX cart functionality for interacting with the Shopify AJAX API so you don't need an "Update Cart" button
* Dependency: jQuery 1.6+
* Author: Ryan Marshall (ryan@schmoove.co.nz)
* License: Free
* Usage:
*
* $('#cart-form').shopifyAJAXCart({
* item: '.line-item-container',