Skip to content

Instantly share code, notes, and snippets.

void 0===window.customElements.get("bundle-product")&&(window.customElements.define("bundle-product",class extends HTMLElement{constructor(){super(),this.tooltips=this.querySelectorAll("[data-bundle-section-tooltip]"),this.initTooltips()}initTooltips(){void 0!==this.tooltips&&null!==this.tooltips&&this.tooltips.forEach((t=>{this.initTippy(t)}))}initTippy(t){const e=t.getAttribute("data-bundle-section-tooltip"),a=t.getAttribute("data-bundle-section-tooltip-content");t.hasAttribute("data-bundle-section-tooltip-addon")?tippy(`[data-bundle-section-tooltip="${e}"]`,{content:a,duration:300,interactive:!0,placement:"bottom"}):tippy(`[data-bundle-section-tooltip="${e}"]`,{content:a,duration:300,interactive:!0})}}),void 0===window.customElements.get("product-card-2")&&(window.customElements.define("product-card-2",class extends HTMLElement{constructor(){super(),this.tooltips=this.querySelectorAll("[data-product-card-tooltip]"),void 0!==this.tooltips&&null!==this.tooltips&&this.initTooltips()}initTooltips(){this.toolti
void 0===window.customElements.get("bundle-product")&&(window.customElements.define("bundle-product",class extends HTMLElement{constructor(){super(),this.tooltips=this.querySelectorAll("[data-bundle-section-tooltip]"),this.initTooltips()}initTooltips(){void 0!==this.tooltips&&null!==this.tooltips&&this.tooltips.forEach((t=>{this.initTippy(t)}))}initTippy(t){const e=t.getAttribute("data-bundle-section-tooltip"),a=t.getAttribute("data-bundle-section-tooltip-content");t.hasAttribute("data-bundle-section-tooltip-addon")?tippy(`[data-bundle-section-tooltip="${e}"]`,{content:a,duration:300,interactive:!0,placement:"bottom"}):tippy(`[data-bundle-section-tooltip="${e}"]`,{content:a,duration:300,interactive:!0})}}),void 0===window.customElements.get("product-card-2")&&(window.customElements.define("product-card-2",class extends HTMLElement{constructor(){super(),this.tooltips=this.querySelectorAll("[data-product-card-tooltip]"),void 0!==this.tooltips&&null!==this.tooltips&&this.initTooltips()}initTooltips(){this.toolti
// Without jQuery
// Define a convenience method and use it
var ready = (callback) => {
if (document.readyState != "loading") callback();
else document.addEventListener("DOMContentLoaded", callback);
}
ready(() => {
var dummyMuralPrice;
fetch(window.Shopify.routes.root + 'products/dummy-mural.js')
@JulianSchnehage
JulianSchnehage / Much much simpler option selector for Shopify
Created September 10, 2021 22:54 — forked from skillmatic-co/Much much simpler option selector for Shopify
Much simpler version of Shopify's option_selection.js for separating product options into their own dropdown menus.
<form action="/cart/add" method="post">
{% if product.variants.size > 1 %}
{% if product.options[0] %}
<label for="select-one">{{ product.options[0] }}</label>
<select id="select-one" onchange="letsDoThis()">
{% for value in product.options_with_values[0].values %}
<option value="{{ value }}" {% if product.options_with_values[0].selected_value == value %}selected{% endif %}>
{{ value }}
</option>
{% endfor %}
@JulianSchnehage
JulianSchnehage / _Region Selector
Last active August 26, 2019 14:33
Region Selector
Title file