Skip to content

Instantly share code, notes, and snippets.

View msmithstubbs's full-sized avatar

Matt Stubbs msmithstubbs

View GitHub Profile
@msmithstubbs
msmithstubbs / back-in-stock.liquid
Created January 5, 2015 15:12
Back in Stock form for Pacific theme (Shopify)
<style>
.BIS_form {
text-align: center;
margin-top: 20px;
display: none;
}
.BIS_form label {
display: block;
}
@msmithstubbs
msmithstubbs / back-in-stock.liquid
Created December 3, 2014 10:07
Back In Stock Product page form with mailing list checkbox
<div>
<label for="bis-email">Email me when available</label>
<input type="email" id="bis-email">
<label>
<input type="checkbox" id="bis-accepts-marketing">
Add me to the store mailing list
</label>
<button id="bis-submit">Email when available</button>
</div>
@msmithstubbs
msmithstubbs / back_in_stock_button.html
Last active August 29, 2015 14:10
Back In Stock link for Tictail product page
<p>
<a class="BIS_button" style="display: none;" onclick="BIS.Dialog.show(); return false;" href="#">Can't find your size?</a>
</p>
<script>
var showBISBtn = false;
{{#variations}}
{{#out_of_stock}}
showBISBtn = true;
{{/out_of_stock}}
{{/variations}}
@msmithstubbs
msmithstubbs / back-in-stock.liquid
Last active August 29, 2015 14:08
Back In Stock form for Shopify Simple theme
<div class="BIS_container">
<p>Be the first to know when this is available to order again.</p>
<input type="text" name="BIS_email" class="BIS_email" placeholder="email address">
<input type="button" class="btn BIS_button" value="Email when available">
<p class="BIS_response"> </p>
</div>
<script>
$(function() {
@msmithstubbs
msmithstubbs / back-in-stock.html
Created October 8, 2014 09:59
Back In Stock inline page form
<div class="soldOut">
<h3>Email when available</h3>
<p>
<input type="text" name="BIS_email" class="BIS_email" placeholder="Enter email">
<button type="button" class="BIS_submit">GO</button>
</p>
<p class="BIS_response"></p>
<script>
/* Back In Stock app */
@msmithstubbs
msmithstubbs / gist:4d69591ffceb40de966a
Last active September 15, 2016 23:46
Product page Back in Stock button for SEOshop/Lightspeed
{% if product.stock.track and not product.stock.on_stock %}
<a href="#" class="btn" id="BIS_trigger">Email when available</a>
{% endif %}
@msmithstubbs
msmithstubbs / product-notify-me.liquid
Last active August 29, 2015 14:05
Single variant dropdown for Retina Notify Me form
{% assign show_form = settings.notify_me_form %}
{% if product.tags contains 'bis_hidden' %}
{% assign show_form = false %}
{% endif %}
{% if show_form %}
<div class="notify_form" id="notify-form-{{ product.id }}" {% if product.available %}style="display:none"{% endif %}>
<form action="/contact" method="post" data-first-variant="{{product.variants.first.id}}" id="BIS_form" onsubmit="return createNotification{{product.id}}(this); return false;">
{% if product.available == false and product.variants.size > 1 %}
@msmithstubbs
msmithstubbs / gist:091478c914ef16a5e734
Created August 2, 2014 10:02
Accepts marketing checkbox with inline form
$('#bis-submit').on('click', function(e) {
e.preventDefault();
var email = $('#bis_email').val(),
variant = $('.size-handle.options li.hovered').data('variant'),
productId = BISPopover.product.id,
options = {
accepts_marketing: $('#notify_opt_in').is(':checked')
};
@msmithstubbs
msmithstubbs / create.js
Last active August 29, 2015 14:03
Calling Back In Stock API from a third party site using JSONP
$.ajax({
url: 'https://app.backinstock.org/stock_notification/create.json',
jsonp: 'callback',
dataType: "jsonp",
data: {
shop: 'feil-llc8678.myshopify.com',
variant: {
variant_no: 665433569
},
notification: {
# this goes in ~/.freeagent
ENV['FA_COMPANY'] = 'mycompany'
ENV['FA_USERNAME'] = 'myloginemail'
ENV['FA_PASSWORD'] = 'mypassword'