Skip to content

Instantly share code, notes, and snippets.

@seedcms
seedcms / lookbooks-app-loading-fix.js
Created December 8, 2017 19:42
lookbooks-app-loading-fix.js - no jquery loader
// Localize jQuery variable
var fancyBox = 'no';
var masonry = 'no';
var images = 'no';
var bxSlider = 'no';
var slickSlider = 'no';
function scripts_loaded(scriptName){
@seedcms
seedcms / product-swatches.liquid
Created August 21, 2017 07:47
product-swatches.liquid
<div class="product-swatches product-swatches-{{product.id}}" data-id="{{product.id}}" data-tag="{{product.metafields.swatch.tag}}"></div>
<div style="clear:both;"></div>
<script src="{{ 'product-swatches.js' | asset_url }}" defer></script>
@seedcms
seedcms / product-swatches.js
Last active January 4, 2018 17:16
product-swatches.js
jQuery(document).ready(function(){
function go_swatch(product_id){
var appDomain = 'https://productswatches-herokuapp-com.global.ssl.fastly.net';
var url = appDomain + '/product_swatches/get-json/'+product_id;
if(product_tag){
var data = {
return_format: 'html',
@seedcms
seedcms / lookbooks-app.liquid
Last active December 5, 2017 18:08
lookbooks app snippet v3
{% if product.id %}
{% assign product_id = product.id %}
{% else %}
{% assign product_id = 0 %}
{% endif %}
{% if page.id %}
{% assign page_id = page.id %}
{% else %}
{% assign page_id = 0 %}
@seedcms
seedcms / pressify-modal-v1-external-link.liquid
Last active March 8, 2017 18:49
pressify-modal-v1-external-link
@seedcms
seedcms / pressify-content-v1-external-link.liquid
Last active March 8, 2017 18:49
pressify-content-v1-external-link
@seedcms
seedcms / other-product-swatches-with-dropdown.liquid
Created February 18, 2017 19:54
product swatches with dropdown
<div class="product-swatches-{{product.id}}-2"></div>
<div class="product-swatches-{{product.id}}"></div>
<div style="clear:both;"></div>
<style>
.product-swatches-ul li {
border-color: #f7f7f7 !important;
max-width: 50px;
border-width: 3px;
}
</style>
@seedcms
seedcms / RSQ.js
Created February 14, 2017 19:42
RS Script
var _rsq = _rsq || [];
_rsq.push([‘_setSiteId’, ‘415’]); Jouer's site ID is 415
_rsq.push([‘_enableOnsite’]);
var email = TBD Use something like document.getelement etc etc, to get the text value, you can call .toString on it to be make sure it is a string as well
_rsq.push([‘_setUserEmail’, email]); // Pass the variable for the email in
_rsq.push(['_setUserProperties', { 'record_id': email,'email': email,'registration_source':'footer'}]); Record_id and email are required for set user props to work, use email as the record_id since it won't be available for a new user.
@seedcms
seedcms / product-swatches-dropdown.liquid
Created February 12, 2017 00:30
product-swatches-with-dropdown
<div class="product-swatches-{{product.id}}-2"></div>
<div class="product-swatches-{{product.id}}"></div>
<div style="clear:both;"></div>
<script>
jQuery(document).ready(function(){
$(document.body).on('change','.go-color',function(){
window.location = $(".go-color").val();
})
@seedcms
seedcms / xyz_1
Created February 4, 2017 06:16
XYZ Script
money = Money.zero
Input.cart.line_items.each do |line_item|
cart = Input.cart
product = line_item.variant.product
money+=line_item.line_price
if cart.discount_code.code == "XYZ"
if product.tags.include?('shoes')