Skip to content

Instantly share code, notes, and snippets.

<script>
window.HYPERVISUAL_CALLBACKS = {
afterProductEmbed: function() {
$(this).find('form').each(function() {
$(this).attr('action', $(this).attr('action').replace('https://vivierskin.com', ''));
});
$(this).find('a').each(function() {
$(this).attr('href', $(this).attr('href').replace('https://vivierskin.com', ''));
});
}
https://cdn.shopify.com/s/files/1/0033/4807/0511/files/download.html?id=8207a89c-2363-4636-90f5-d48f0e42224e&amp;uu=09a35479-deff-4eaf-bbf5-a4852e14a4d8&amp;mo=&amp;fi=SW1hZ2UgQTItdy5qcGc=&amp;image=true
<script>
window.UploadKit = window.UploadKit || {}
window.UploadKit.callbacks = {
afterRefresh: function(data) {
if(window.UploadKit.product && window.UploadKit.product.tags && window.UploadKit.product.tags.indexOf('multi-frame') > -1) { return }
if(data.files && data.files.length > 0) {
$('input[name=quantity]').val(data.files.length)
}
}
}
<script>
window.InstaBuy = window.InstaBuy || {}
window.InstaBuy.target = "_self"
window.InstaBuy.afterRender = function(el) {
var quantityInputs = el.querySelectorAll(".widget-quantity-input:not(.minmaxify)");
for(var i = 0; i < quantityInputs.length; i++) {
var input = quantityInputs[i]
if(!input.dataset.productHandle || input.dataset.productHandle.length === 0) { continue }
var limits = minMaxify && minMaxify.getIndividualLimitsFor && minMaxify.getIndividualLimitsFor({handle: input.dataset.productHandle});
if(limits) {
@tobymarsden
tobymarsden / gist:63856d08ec7a43c13742b73ff09c06b8
Created June 21, 2019 08:06
line item properties in cart
{% for p in item.properties %}
{% assign first_character_in_key = p.first | truncate: 1, '' %}
{% unless p.last == blank or first_character_in_key == '_' %}
{{ p.first }}:
{{ p.last }}
<br>
{% endunless %}
{% endfor %}
.uploadcare--button {
border-color: #601B1B;
}
.uploadcare--button:hover {
border-color: #601B1B;
}
.uploadcare--button_primary {
background-color: #601B1B;
}
@tobymarsden
tobymarsden / ella.js
Last active July 9, 2019 22:34
Ella theme line item properties
initProductAddToCart: function() {
if ($('#product-add-to-cart').length > 0) {
$('#product-add-to-cart').click(function(event) {
event.preventDefault();
if ($(this).attr('disabled') != 'disabled') {
if (!window.ajax_cart) {
$(this).closest('form').submit();
} else {
var variant_id = $('#add-to-cart-form select[name=id]').val();
if (!variant_id) {
<script>
window.UploadKit = window.UploadKit || {}
window.UploadKit.callbacks = {
afterRefresh: function(data) {
// data is an object like:
// {
// el: <html element of the upload field container div>,
// uploader: <json object representing the upload field>,
// files: <json array representing the uploaded files>
// }
@tobymarsden
tobymarsden / gist:ef9ddc2e2213a8ceaf650f33240ab1f9
Last active October 16, 2019 20:35
Direct link in order printer template
{% for p in line_item.properties %}
{% if p.first contains 'direct link' %}
<img src="{{p.last}}" style="width: 5cm;" />
<br>
{% endif %}
{% endfor %}
uploading: 'Hochladen... Bitte warten.'
loadingInfo: 'Laden der Informationen...'
errors:
default: 'Error'
baddata: 'Falscher Wert'
size: 'Datei zu groß'
upload: 'Kann nicht hochgeladen werden'
user: 'Hochladen abgebrochen'
info: 'Informationen können nicht geladen werden'
image: 'Nur Bilder sind erlaubt'