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
<template id="shopify_body_scripts">
<body>
// your scripts
</body>
</template>
<script>
(() => {
const shopify_body_scripts = document?.getElementById('shopify_body_scripts');
if (!shopify_body_scripts) {
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);