Skip to content

Instantly share code, notes, and snippets.

View savchukoleksii's full-sized avatar

Oleksii Savchuk savchukoleksii

  • Ukraine
View GitHub Profile
https://4e0640aa8a4230debb0b5e9c07097214:[email protected]/admin/api/2023-01/products.json?fields=id,updated_at&order=updated_at asc
<script>
let temp = document.createElement("div");
temp.innerHTML = document.getElementById('shopify_header_scripts').innerHTML
.replace('</head>', '');
let elements = temp.children;
let lazyElements = [];
// Loop through each element
for (var i = 0; i < elements.length; i++) {
// Create a new element
curl https://api.stripe.com/v1/apple_pay/domains -u "sk_test_51Ko7phGPTI0ZBDJuFEfb9Ta93RNow2GryOtR8gCC9O5yZeDUhHLHiUBs9mZLnLYdDctorGJgLlpFuD9xaWGErBQA00UeTkGFet": -d domain_name="savchukoleksii1.loca.lt"
curl https://api.stripe.com/v1/apple_pay/domains -u "sk_test_cTpxjDLRdqXX97lGBdUjMUDE": -d domain_name="savchukoleksii.loca.lt"
{%- assign section_customizer_settings = "" -%}
{%- for setting in section.settings -%}
{%- capture setting_data -%}
"{{- setting -}}": {{- section.settings[setting] | json -}}
{%- endcapture -%}
{%- if section_customizer_settings != blank -%}
{%- assign section_customizer_settings = section_customizer_settings | append: "," -%}
{%- endif -%}
import serialize from "form-serialize";
export function addToCartSubmit(event) {
event.preventDefault();
const form = event.target;
let formData = serialize(form, {
hash: true,
disabled: true,
/* Simple Popup */
.popup {
position: fixed;
left: 0;
top: 0;
z-index: 30;
opacity: 0;
visibility: hidden;
display: flex;
async function getProductById(id) {
const handle = (await fetch(`/search/suggest.json?q=id:${id}&resources[type]=product&limit=1`)
.then(response => response.json())
.then(response => response.resources.results.products.shift())).handle;
return await fetch(`/products/${handle}.js`).then(response => response.json());
}
const product = await getProductById(2083844620358);
if(window.location.pathname.includes("/collections")) {
(async () => {
const meta = await fetch("https://www.kasper.com/collections/clothing?view=meta").then(response => response.text()).then(response => JSON.parse(response));
const products = (await Promise.all(Array.from(new Array(meta.pages).keys()).map(page => page + 1).map((page) => {
return fetch(`https://www.kasper.com/collections/clothing/products.json?page=${page}`).then(response => response.json());
}))).map(products => products.products).reduce((result, products) => {
return [
...result,
...products,