Skip to content

Instantly share code, notes, and snippets.

View martinsoender's full-sized avatar

Martin Søndergaard martinsoender

View GitHub Profile
{
"name": "Christopher Cloos",
"key": "cca08230-da90-11eb-a86e-02766dea5d8a",
"scoutfile": {
"url": "https://api.vertebrae-axis.com/tag/scoutfile/v1.25.1/bundle.js"
},
"objectViewer": {
"url": "https://api.vertebrae-axis.com/branch/objectViewer/feature/safari_15_fix/main.js"
},
"arButton": {
@martinsoender
martinsoender / script.rb
Created November 15, 2021 16:17
Tiered Discounts By Spending Threshold
# Define spending thresholds, from lowest spend to highest spend.
SPENDING_THRESHOLDS = [
{
spend: 10000, # spend amount (in cents)
discount: 15 # percentage discount
},
{
spend: 20000,
discount: 20
},
@martinsoender
martinsoender / shopify-fb-tracking.liquid
Created November 22, 2021 09:14
Replace <insert_pixel_id> with the Facebook pixel id
{% if first_time_accessed %}
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
@martinsoender
martinsoender / vertebrae-transaction-tracking.html
Created November 24, 2021 17:22
Vertebrae transaction script
<script>
window.$AXIS=window.$AXIS||function(){($AXIS.q=$AXIS.q||[]).push(arguments)};$AXIS.l=+new Date;
$AXIS('init', {
'clientId':'cca08230-da90-11eb-a86e-02766dea5d8a',
'environment':'prod'
});
// The addTransaction
$AXIS('ecommerce:addTransaction', {
@martinsoender
martinsoender / index.html
Created February 22, 2023 13:22
GTM - Add to cart event tracking for Shopify
<!-- Example button element. Note class "product-add-to-cart" is not all button elements -->
<button type="button" class="button button-green button-block product-add-to-cart">Add to cart</button>
<script>
// Global DataLayer declaration
window.dataLayer = window.dataLayer || [];
// Fetch all Add to cart button elements
var AddToCartButtons = document.querySelectorAll('.<GLOBAL_ATC_BUTTON_CLASS>');
@martinsoender
martinsoender / index.html
Created March 20, 2023 15:29
Isotope - combination filters with 4 selects with reset, disable non available
<div class="container">
<div class="row">
<div class="zone filter clearfix">
<div class="col-md-2">
<h3>Color</h3>
<label>
<select data-filter-group="color" class="data-selector">
<option class="filter-all" data-filter="" selected> All </option>
<option data-filter=".red"> Red <span class="filter-count"></span></option>
<option data-filter=".yellow"> Yellow <span class="filter-count"></span></option>
@martinsoender
martinsoender / index.html
Created June 12, 2023 11:22
Vuetify Data Table Column Multi-Select Filter w/ Autocomplete Search
<div id="app">
<v-app id="inspire">
<v-data-table
v-model="selected"
:headers="headers"
:items="filteredDesserts"
show-select
item-key="name"
>
<template v-slot:header="{ header }">
@martinsoender
martinsoender / component-cart-drawer.liquid
Last active January 11, 2024 09:27
Shopify Cart Drawer
{% comment %} Globals {% endcomment %}
{%- liquid
assign country_code = blank
if request.host contains '.messyweekend.'
assign country_code = request.host | split: '.' | first
else
assign country_code = request.host | split: '.' | last
endif
-%}