= 0);
})(),
in_enabled_plan: !!_sqPlan,
is_instock_variant: (function () {
var has = function (a) { return Array.isArray(a) && a.indexOf(_sqVidNum) !== -1; };
return has(_sqTrack.inStockVariantIds) ||
has(_sqTrack.cachedInStockVariantIds &&
_sqTrack.cachedInStockVariantIds.in_stock_variant_ids);
})(),
enrolled_plan_id: (_sqPlan && (_sqPlan.shopify_selling_plan_id || _sqPlan.shopify_selling_plan_group_id)) || '',
enrolled_plan_provider: (_sqPlan && _sqPlan.inventory_provider) || '',
block_enabled: !(_sqTrack.cachedSettings && _sqTrack.cachedSettings.block_accelerated_checkout === false) &&
!(_sqTrack.readFlags && _sqTrack.readFlags.accelerated_block_off === true),
gate_armed: !!_sqTrack.acceleratedGateArmed,
gate_active_at_click: !!(document.documentElement &&
document.documentElement.c
ication/json',
'X-Shopify-Storefront-Access-Token': cfg.storefrontAccessToken,
},
body: JSON.stringify({ query: query, variables: variables }),
}
)
.then(function(response) {
if (!response.ok) { throw new Error('Storefront API HTTP ' + response.status); }
return response.json();
})
.then(function(body) {
if (body && body.errors && body.errors.length) {
throw new Error('Storefront API errors: ' + body.errors.map(function(e) { return e && e.message; }).join(', '));
}
return body && body.data;
});
}
function fetchStorefrontShopMetafield(key) {
const cfg = window._RestockRocketConfig;
const query = 'query StoqShopMetafield($namespace: String!, $key: String!) { shop { metafield(namespace: $namespace, key: $key) { value } } }';
return storefrontGraphql(query, { namespace: cfg.metafieldNamespace, key: key })
.then(function(data) {
const value = data && data.shop && data.shop.metafield && data.shop.meta settings;
});
}
const cachedSettings = window._RestockRocketConfig.cachedSettings;
const validCachedSettings = cachedSettings ? checkSettingsExpiry(cachedSettings) : null;
if (validCachedSettings) {
console.debug('STOQ - using cached settings');
initializeScripts(validCachedSettings);
} else {
console.debug('STOQ - fetching fresh settings');
const headers = {
'X-Shopify-Shop-Domain': window._RestockRocketConfig.shop || window.Shopify.shop,
'ngrok-skip-browser-warning': 'skip'
};
if (window.Shopify?.theme?.role === 'main') {
headers['X-Shopify-Theme-Schema-Name'] = window.Shopify.theme.schema_name;
headers['X-Shopify-Theme-Schema-Version'] = window.Shopify.theme.schema_version;
headers['X-Shopify-Theme-Store-Id'] = window.Shopify.theme.theme_store_id;
}
const storefrontRead = window._RestockRocketConfig.readFlags?.enable_storefront_settings_read === true
? Promise.race([
fetchStorefrontSettings(),
new Promi
}
})
.catch(function(e) {
console.error(e)
})
}
function fetchEmbedConfig(endpoint, apply) {
return fetch(
`${window._RestockRocketConfig.host}/api/v1/embed/${endpoint}.json`,
{
headers: {
'X-Shopify-Shop-Domain': window._RestockRocketConfig.shop || window.Shopify.shop,
'ngrok-skip-browser-warning': 'skip'
}
}
)
.then(function(response) {
if (!response.ok) throw new Error(`Failed to fetch ${endpoint}`);
return response.json();
})
.then(function(data) {
try {
apply(data);
} catch (applyError) {
console.error('STOQ - apply failed for ' + endpoint + ':', applyError);
throw applyError;
}
})
.catch(function(error) {
console.debug(`STOQ - using cached ${endpoint}:`, error.message);
});
}
function refreshShopConfig(source) {
const cfg = window._RestockRocketConfig;
const viaEmbed = function() { return fetchEmbedConfig(source.endpoint, a) {
cfg.integrations = data;
}
});
}
function refreshSellingPlans(embedOnly) {
const cfg = window._RestockRocketConfig;
return refreshShopConfig({
embedOnly: embedOnly === true,
endpoint: 'selling_plans',
metafieldKey: 'cachedSellingPlans',
flag: 'enable_storefront_selling_plans_read',
isValid: function(value) { return !!value && Array.isArray(value.plans); },
apply: function(data) {
cfg.sellingPlans = data.plans;
cfg.disabledSellingPlanIds = data.disabled_plan_ids || [];
if (data && data.read_flags && typeof data.read_flags === 'object' && !Array.isArray(data.read_flags)) {
cfg.readFlags = data.read_flags;
}
}
});
}
function initializeScripts(settings) {
settings = applyTranslations(settings);
window._RestockRocketConfig.settings = settings;
console.debug(`STOQ - settings configured for ${window._RestockRocketConfig.pageType}`);
const forceEmbedSellingPlans = settings.foncludes(window._RestockRocketConfig.pageType);
})
const hasEnabledOffer = Array.isArray(window._RestockRocketConfig.sellingPlans)
&& window._RestockRocketConfig.sellingPlans.some(function(plan) { return plan && plan.enabled; });
const hasDisabledPlanIds = Array.isArray(window._RestockRocketConfig.disabledSellingPlanIds)
&& window._RestockRocketConfig.disabledSellingPlanIds.length > 0;
const usePreorderBuild = settings.preorder_enabled || hasEnabledOffer || hasDisabledPlanIds;
const pageType = window._RestockRocketConfig.pageType;
const preorderUiOnPage = (settings.preorder_enabled && settings[`preorder_${pageType}_enabled`])
|| window._RestockRocketConfig.integrations.some(function(integration) {
return (integration.type === 'quick_buy' || integration.type === 'featured_product')
&& integration.enabled && integration.page_types.includes(pageType);
})
|| /\b(renderPreorderButton|updateAddToCartButton|updateAddToChtml.stoq-buy-now-pending .shopify-payment-button{pointer-events:none!important}
| Service | |
| Servicing | |
| Workshop Prices | |
| Delivery & Returns | |
| Sat: 9:00 - 16:00 | Sun: Closed0131 374 5324 | Newington Road
| [email protected] | |
| await import("https://cdn.shopify.com/shopifycloud/shop-js/modules/v2/loader.shop-follow-button.en.esm.js"); | |
| Country | GBP£ |
| Åland Islands (EUR€) | |
| } }) .catch(function(e) { console.error(e) }) } function fetchEmbedConfig(endpoint, apply) { return fetch( `${window._RestockRocketConfig.host}/api/v1/embed/${endpoint}.json`, { headers: { 'X-Shopify-Shop-Domain': window._RestockRocketConfig.shop || window.Shopify.shop, 'ngrok-skip-browser-warning': 'skip' } } ) .then(function(response) { if (!response.ok) throw new Error(`Failed to fetch ${endpoint}`); return response.json(); }) .then(function(data) { try { apply(data); } catch (applyError) { console.error('STOQ - apply failed for ' + endpoint + ':', applyError); throw applyError; } }) .catch(function(error) { console.debug(`STOQ - using cached ${endpoint}:`, error.message); }); } function refreshShopConfig(source) { const cfg = window._RestockRocketConfig; const viaEmbed = function() { return fetchEmbedConfig(source.endpoint | ata) { cfg.integrations = data; } }); } function refreshSellingPlans(embedOnly) { const cfg = window._RestockRocketConfig; return refreshShopConfig({ embedOnly: embedOnly === true, endpoint: 'selling_plans', metafieldKey: 'cachedSellingPlans', flag: 'enable_storefront_selling_plans_read', isValid: function(value) { return !!value && Array.isArray(value.plans); }, apply: function(data) { cfg.sellingPlans = data.plans; cfg.disabledSellingPlanIds = data.disabled_plan_ids || []; if (data && data.read_flags && typeof data.read_flags === 'object' && !Array.isArray(data.read_flags)) { cfg.readFlags = data.read_flags; } } }); } function initializeScripts(settings) { settings = applyTranslations(settings); window._RestockRocketConfig.settings = settings; console.debug(`STOQ - settings configured for ${window._RestockRocketConfig.pageType}`); const forceEmbedSellingPlans = settings..includes(window._RestockRocketConfig.pageType); }) const hasEnabledOffer = Array.isArray(window._RestockRocketConfig.sellingPlans) && window._RestockRocketConfig.sellingPlans.some(function(plan) { return plan && plan.enabled; }); const hasDisabledPlanIds = Array.isArray(window._RestockRocketConfig.disabledSellingPlanIds) && window._RestockRocketConfig.disabledSellingPlanIds.length > 0; const usePreorderBuild = settings.preorder_enabled || hasEnabledOffer || hasDisabledPlanIds; const pageType = window._RestockRocketConfig.pageType; const preorderUiOnPage = (settings.preorder_enabled && settings[`preorder_${pageType}_enabled`]) || window._RestockRocketConfig.integrations.some(function(integration) { return (integration.type === 'quick_buy' || integration.type === 'featured_product') && integration.enabled && integration.page_types.includes(pageType); }) || /\b(renderPreorderButton|updateAddToCartButton|updateAddT | ration) { createRestockRocketScript(preorderCollectionScriptUrl); } else if(usePreorderBuild) { createRestockRocketScript(preorderCollectionScriptUrl); } else { console.debug(`STOQ - no scripts enabled for ${pageType}`); } const wishlistIntegration = window._RestockRocketConfig.integrations.find(function(integration) { return integration.type === 'wishlist' && integration.enabled; }); if (wishlistIntegration) { createRestockRocketScript(window._RestockRocketConfig.scriptHost + 'restockrocket-wishlist.js'); if ((wishlistIntegration.page_types || []).indexOf(pageType) !== -1) { let wishlistHeartsRequested = false; const loadWishlistHearts = function() { if (wishlistHeartsRequested || !document.querySelector('[data-stoq-wishlist-heart]')) return; wishlistHeartsRequested = true; createRestockRocketScript(window._RestockRocketConfig.scriptHost + 'restockrocket-wishlist-hearts.js');
Réunion (EUR€)
Tunisia (GBP£)
Ukraine (UAH₴)










