Skip to content

Instantly share code, notes, and snippets.

<script>
$(document).on('click',"#AddToCart-product-template, .buy-bar [name=add]", function() {
console.log('added');
var cartString = $('#CartCount').html();
var miniCounter = parseInt(cartString);
var qty = 1;
var id;
{% if product.variants.size > 1 %}
id = $('.variant-select-for-id option:selected').data('variant');
@j7u7l7s
j7u7l7s / Tags in reg form.liquid
Created November 6, 2018 21:29
Liquid to add tags to new customer on creation + create a new tag with the company name field prefixed with 'company_'
<div id="company_name_field" class="clearfix large_form">
<label for="company_name" class="login">
Trading / Store Name - to appear on invoices and our store locator *
</label>
<input type="text" value="" name="customer[note][Company Name]" id="company_name" class="large" size="30" required />
</div>
<input type="hidden" id="processed_prospect_and_company_name" name="customer[tags]" value="Prospect"/>
<script type="text/javascript">
@j7u7l7s
j7u7l7s / sass-buttons.scss
Created February 4, 2019 15:20
A logical and modular way of styling buttons with SCSS
.action_button {
background-color: #999;
border-color: #999;
&:hover {
background-color: lighten(#999, 10%);
border-color: lighten(#999, 10%);
}