tDisabled":false},"type":"hijack","css_config":null,"js_config":null,"created_at":"2025-07-26T09:16:04.076Z","updated_at":"2025-07-26T09:16:04.076Z"}];window._RestockRocketConfig.product = {
id: 15846731678079,
title: "District+ 4 Lowstep",
handle: "district-4-lowstep-36972",
vendor: "Trek",
tags: ["2026","Bike","EBIKE","END OF LIFE","ETR - E-Trekking","spo-cs-disabled","spo-default","spo-disabled","spo-notify-me-disabled","Trek"],
available: true,
options: ["Colour","Size","Variant"],
selling_plan_groups: [],
featured_image: "\/\/projektride.co.uk\/cdn\/shop\/files\/District_Plus_4_Low_23_36972_B_Primary_78d836e9-40e5-4544-ae53-283cd1997a10.jpg?v=1787065202\u0026width=800",
variants: [{
id: 58205427040639,
title: "Pennyflake \/ L \/ 5295037",
available: true,
sku: "5295037",
price: 327500
},
{
id: 58205427073407,
title: "Pennyflake \
Spain (EUR€)
/ L \/ 5295038",
available: true,
sku: "5295038",
price: 350000
},
{
id: 58205427106175,
title: "Pennyflake \/ L \/ 5295039",
available: true,
sku: "5295039",
price: 387500
},
{
id: 58205427138943,
title: "Pennyflake \/ M \/ 5295033",
available: false,
sku: "5295033",
price: 327500
},
{
id: 58205427171711,
title: "Pennyflake \/ M \/ 5295034",
available: false,
sku: "5295034",
price: 350000
},
{
id: 58205427204479,
title: "Pennyflake \/ M \/ 5295035",
available: false,
sku: "5295035",
price: 387500
},
{
id: 58205427237247,
title: "Pennyflake \/ XL \/ 5295041",
available: true,
sku: "5295041",
price: 327500
},
{
id: 58205427270015,
title: "Pennyflake \/ XL \/ 5295042",
available: true,
sku: "5295042",
price: 350000
},
{
id: 58205427302783,
title: "Pennyflake \/ XL \/ 5295043",
available: true,
sku: "5295043",
price: 387500
},
{
id: 58205427335551,
title: "Trek Black Satin \/ L \/ 5295021",
available: false,
sku: "5295021",
price: 327500
},
{
id: 58205427368319,
title: "Trek Black Satin \/ L \/ 5295022",
available: true,
sku: "5295022",
price: 350000
},
{
id: 58205427401087,
title: "Trek Black Satin \/ L \/ 5295023",
available: true,
sku: "5295023",
price: 387500
},
{
id: 58205427433855,
title: "Trek Black Satin \/ M \/ 5295017",
available: false,
sku: "5295017",
price: 327500
},
{
id: 58205427466623,
title: "Trek Black Satin \/ M \/ 5295018",
available: false,
sku: "5295018",
price: 350000
},
{
id: 58205427499391,
title: "Trek Black Satin \/ M \/ 5295019",
available: false,
sku: "5295019",
price: 387500
},
{
id: 58205427532159,
title: "Trek Black Satin \/ S \/ 5295013",
available: false,
sku: "5295013",
price: 327500
},
{
id: 58205427564927,
title: "Trek Black Satin \/ S \/ 5295014",
available: false,
sku: "5295014",
price: 350000
},
{
id: 58205427597695,
title: "Trek Black Satin \/ S \/ 5295015",
available: false,
sku: "5295015",
price: 387500
},
{
id: 582054276304
63,
title: "Trek Black Satin \/ XL \/ 5295025",
available: true,
sku: "5295025",
price: 327500
},
{
id: 58205427663231,
title: "Trek Black Satin \/ XL \/ 5295026",
available: true,
sku: "5295026",
price: 350000
},
{
id: 58205427695999,
title: "Trek Black Satin \/ XL \/ 5295027",
available: true,
sku: "5295027",
price: 387500
}
]
};window._RestockRocketConfig.variantsInventoryPolicy = {58205427040639 : "deny",58205427073407 : "deny",58205427106175 : "deny",58205427138943 : "deny",58205427171711 : "deny",58205427204479 : "deny",58205427237247 : "deny",58205427270015 : "deny",58205427302783 : "deny",58205427335551 : "deny",58205427368319 : "deny",58205427401087 : "deny",58205427433855 : "deny",58205427466623 : "deny",58205427499391 : "deny",58205427532159 : "deny",58205427564927 : "deny",58205427597695 : "deny",58
205427630463 : "deny",58205427663231 : "deny",58205427695999 : "deny",};
window._RestockRocketConfig.variantsInventoryQuantity = {58205427040639 : parseInt("1"),58205427073407 : parseInt("51"),58205427106175 : parseInt("51"),58205427138943 : parseInt("0"),58205427171711 : parseInt("0"),58205427204479 : parseInt("0"),58205427237247 : parseInt("1"),58205427270015 : parseInt("18"),58205427302783 : parseInt("18"),58205427335551 : parseInt("0"),58205427368319 : parseInt("3"),58205427401087 : parseInt("3"),58205427433855 : parseInt("0"),58205427466623 : parseInt("0"),58205427499391 : parseInt("0"),58205427532159 : parseInt("0"),58205427564927 : parseInt("0"),58205427597695 : parseInt("0"),58205427630463 : parseInt("1"),58205427663231 : parseInt("51"),58205427695999 : parseInt("51"),};
window._RestockRocketConfig.variantsPreorderCount = {58205427040639 : parseInt(""),58205427073407 : parseInt(""),58205427106175 : parseInt(""),58205427138943 : parseInt(""),58205427171711 : parseInt(""),58205427204479 : parseInt(""),58205427237247 : parseInt(""),58205427270015 : parseInt(""),58205427302783 : parseInt(""),58205427335551 : parseInt(""),58205427368319 : parseInt(""),58205427401087 : parseInt(""),58205427433855 : parseInt(""),58205427466623 : parseInt(""),58205427499391 : parseInt(""),58205427532159 : parseInt(""),58205427564927 : parseInt(""),58205427597695 : parseInt(""),58205427630463 : parseInt(""),58205427663231 : parseInt(""),58205427695999 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderCountForMarket = {58205427040639 : null,58205427073407 : null,58205427106175 : null,58205427138943 : null,58205427171711 : null,58205427204479 : null,58205427237247 : null,58205427270015 : null,58205427302783 : null,58205427335551 : null,58205427368319 : null,58205427401087 : null,58205427433855 : null,58205427466623 : null,58205427499391 : null,58205427532159 : null,58205427564927 : null,58205427597695 : null,58205427630463 : null,58205427663231 : null,58205427695999 : null,};
window._RestockRocketConfig.v
ariantsPreorderMaxCount = {58205427040639 : parseInt(""),58205427073407 : parseInt(""),58205427106175 : parseInt(""),58205427138943 : parseInt(""),58205427171711 : parseInt(""),58205427204479 : parseInt(""),58205427237247 : parseInt(""),58205427270015 : parseInt(""),58205427302783 : parseInt(""),58205427335551 : parseInt(""),58205427368319 : parseInt(""),58205427401087 : parseInt(""),58205427433855 : parseInt(""),58205427466623 : parseInt(""),58205427499391 : parseInt(""),58205427532159 : parseInt(""),58205427564927 : parseInt(""),58205427597695 : parseInt(""),58205427630463 : parseInt(""),58205427663231 : parseInt(""),58205427695999 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderMaxCountForMarket = {58205427040639 : null,58205427073407 : null,58205427106175 : null,58205427138943 : null,58205427171711 : null,58205427204479 : null,58205427237247 : null,58205427270015 : null,58205427302783 : null,58205427335551 : null,58205427368319 : null,58205427401087 : null,58205427433855 : null,582054274
66623 : null,58205427499391 : null,58205427532159 : null,58205427564927 : null,58205427597695 : null,58205427630463 : null,58205427663231 : null,58205427695999 : null,};
window._RestockRocketConfig.variantsShippingText = {58205427040639 : "",58205427073407 : "",58205427106175 : "",58205427138943 : "",58205427171711 : "",58205427204479 : "",58205427237247 : "",58205427270015 : "",58205427302783 : "",58205427335551 : "",58205427368319 : "",58205427401087 : "",58205427433855 : "",58205427466623 : "",58205427499391 : "",58205427532159 : "",58205427564927 : "",58205427597695 : "",58205427630463 : "",58205427663231 : "",58205427695999 : "",};
window._RestockRocketConfig.variantsShippingTextForMarket = {58205427040639 : null,58205427073407 : null,58205427106175 : null,58205427138943 : null,58205427171711 : null,58205427204479 : null,58205427237247 : null,58205427270015 : null,58205427302783 : null,58205427335551 : null,58205427368319 : null,58205427401087 : null,58205427433855 : null,58205427466623 : null,58
St. Helena (SHP£)
205427499391 : null,58205427532159 : null,58205427564927 : null,58205427597695 : null,58205427630463 : null,58205427663231 : null,58205427695999 : null,};window._RestockRocketConfig.selected_variant_id = 58205427040639;
window._RestockRocketConfig.selected_variant_available = (window._RestockRocketConfig.product.variants.find(function(variant) { return variant.id == window._RestockRocketConfig.selected_variant_id }) || {}).available;
try {
var _sqCfg = window._RestockRocketConfig;
var _sqPlanEnabled = Array.isArray(_sqCfg.sellingPlans) &&
_sqCfg.sellingPlans.some(function (p) { return p && p.enabled; });
var _sqPreCount = ((_sqCfg.cachedPreorderVariantIds &&
_sqCfg.cachedPreorderVariantIds.preorder_variant_ids) || []).length;
_sqCfg.preordersConfigured = !!(_sqPlanEnabled && _sqPreCount);
} catch (e) { }
try {
var _sqc = window._RestockRocketConfig;
var _sqOn = !(_sqc.cachedSettings && _sqc.cachedSettings.block_accelerated_checkout === false);
var _sqPre = (_sqc.cachedPreorderVariantIds &&
_sqc.cachedPreorderVariantIds.preorder_variant_ids) || [];
var _sqArm = false;
if (_sqOn && _sqc.preordersConfigured) {
if (_sqc.pageType === 'product' && _sqc.product && _sqc.product.variants) {
_sqArm = _sqc.product.variants.some(function (v) { return _sqPre.indexOf(Number(v.id)) !== -1; });
} else {
_sqArm = (_sqc.integrations || []).some(function (i) {
return i && i.type === 'featured_product' && i.enabled &&
Array.isArray(i.page_types) && i.page_types.indexOf(_sqc.pageType) !== -1;
});
}
}
if (_sqArm && document.documentElement) {
_sqc.acceleratedGateArmed = true;
document.documentElement.classList.add('stoq-buy-now-pending');
setTimeout(function () {
document.documentElement.classList.remove('stoq-buy-now-pending');
}, 6000);
}
} catch (e) { }
window._RestockRocketConfig.scriptUrlProduct = 'https://cdn.shopify.com/extensions/01a0dd9a-8d45-700e-8b7c
-b94a078fbbdd/restockrocket-1-598/assets/restockrocket-product.js'
window._RestockRocketConfig.scriptUrlCollection = 'https://cdn.shopify.com/extensions/01a0dd9a-8d45-700e-8b7c-b94a078fbbdd/restockrocket-1-598/assets/restockrocket-collection.js'
window._RestockRocketConfig.scriptUrlProductBis = 'https://cdn.shopify.com/extensions/01a0dd9a-8d45-700e-8b7c-b94a078fbbdd/restockrocket-1-598/assets/restockrocket-product-bis.js'
window._RestockRocketConfig.scriptUrlCollectionBis = 'https://cdn.shopify.com/extensions/01a0dd9a-8d45-700e-8b7c-b94a078fbbdd/restockrocket-1-598/assets/restockrocket-collection-bis.js'
window._RestockRocketConfig.scriptHost = window._RestockRocketConfig.scriptUrlProduct.substring(0, window._RestockRocketConfig.scriptUrlProduct.lastIndexOf('/') + 1)
window._RestockRocketConfig.host = (window._RestockRocketConfig.cachedSettings && window._RestockRocketConfig.cachedSettings.api_host) || 'https://app.restockrocket.io'
try {
const _stoqVersionMatch = window._RestockRocketConfig.s
criptHost.match(/(\d+)\/?(?:assets\/?)?$/);
window._RestockRocketConfig.appVersion = (_stoqVersionMatch && _stoqVersionMatch[1]) || '';
} catch (e) {
window._RestockRocketConfig.appVersion = '';
}
const SETTINGS_CACHE_DURATION = 15 * 60 * 1000;
const LIQUID_CACHE_MAX_AGE = 15 * 60;
const liquidRenderedAt = window._RestockRocketConfig.liquidRenderedAt;
if (!liquidRenderedAt || typeof liquidRenderedAt !== 'number' || isNaN(liquidRenderedAt)) {
console.debug('STOQ - Invalid or missing liquidRenderedAt timestamp, assuming fresh');
window._RestockRocketConfig.isLiquidCacheFresh = true;
window._RestockRocketConfig.liquidCacheAge = null;
} else {
const now = Math.floor(Date.now() / 1000);
const liquidCacheAge = now - liquidRenderedAt;
window._RestockRocketConfig.liquidCacheAge = Math.max(0, liquidCacheAge);
if (liquidCacheAge
<
<
&
!Object.prototype.hasOwnProperty.call(settings.translations, window._RestockRocketConfig.normalizedLocale)) {
console.debug('STOQ - locale not explicitly translated, will use default language from cache');
}
}
const updatedAt = new Date(settings.updated_at);
if (isNaN(updatedAt.getTime())) {
console.debug('STOQ - Invalid updated_at date format in settings');
return null;
}
const age = Date.now() - updatedAt.getTime();
if (age
SETTINGS_CACHE_DURATION) {
console.debug('STOQ - settings changed recently, skipping cache');
return null;
}
return settings;
} catch (error) {
console.debug('STOQ - Error checking settings cache:', error);
return null;
}
}
function createRestockRocketContainer() {
const restockRocketContainer = document.createElement('div');
restockRocketContainer.id = 'restock-rocket';
document.body.appendChild(restockRocketContainer);
}
function createRestockRocketScript(scriptUrl) {
const restockRocketScriptElement = document.createElement('script');
restockRocketScriptElement.setAttribute('defer', 'defer');
restockRocketScriptElement.src = scriptUrl;
document.body.appendChild(restockRocketScriptElement);
}
createRestockRocketContainer()
console.debug('STOQ - extension activated')
try {
const _stoqInitConfig = window._RestockRocketConfig;
const _stoqDetectedVariantIds = (_stoqInitConfig.product && Array.isArray(_stoqI
liquid_cache_age: _stoqInitConfig.liquidCacheAge,
inventory_policy: (_stoqInitConfig.variantsInventoryPolicy || {})[_stoqSelectedVariantId] || '',
inventory_quantity: (_stoqInitConfig.variantsInventoryQuantity || {})[_stoqSelectedVariantId],
});
} catch (e) {
console.debug('STOQ - stoq_initialized publish failed:', e);
}
try {
var _sqTrack = window._RestockRocketConfig;
if (_sqTrack.preordersConfigured) {
document.addEventListener('click', function (e) {
try {
var t = e.target;
if (!t || !t.closest) return;
var host = t.closest('.shopify-payment-button, shopify-payment-terms');
if (!host) return;
var channel = host.matches && host.matches('shopify-payment-terms')
? 'shop_pay_installments' : 'buy_now';
var form = host.closest('form');
var vidEl = form && form.querySelector('[name="id"]');
var variantId = (vidEl && vidEl.value) || _sqTrack.selected_variant_id || '';
ck.product.id) || '',
channel: channel,
market_id: _sqTrack.marketId || '',
country_code: _sqTrack.countryIsoCode || '',
page_type: _sqTrack.pageType || '',
cart_token: _sqTrack.cartToken || '',
page_url: (window.location && window.location.href) || '',
properties: {
is_preorder_variant: (function () {
var vid = Number(variantId);
var has = function (a) { return Array.isArray(a) && a.indexOf(vid) !== -1; };
return has(_sqTrack.preorderVariantIds) ||
has(_sqTrack.cachedPreorderVariantIds &&
_sqTrack.cachedPreorderVariantIds.preorder_variant_ids);
})(),
in_enabled_plan: !!_sqPlan,
is_instock_variant: (function () {
var has = function (a) { return Array.isArray(a) && a.indexOf(_sqVidNum) !== -1; };
return has(_sqTrack.inStockVariantIds) ||
h
});
} catch (err) { }
}, true);
}
} catch (e) { }
function applyTranslations(settings) {
try {
if (!settings || !settings.multi_language_enabled) {
return settings;
}
if (!settings.translations) {
console.debug('STOQ - No translations found, skipping translation');
return settings;
}
const normalizedLocale = window._RestockRocketConfig.normalizedLocale;
const translations = settings.translations;
if (!normalizedLocale) {
console.debug('STOQ - No matching locale for translations. Available:', Object.keys(translations || {}));
delete settings.translations;
return settings;
}
console.debug(`STOQ - Applying translations for normalized locale: ${normalizedLocale} (original: ${window._RestockRocketConfig.locale})`);
const translatedFields = translations[normalizedLocale];
if (translatedFields && typeof translatedFields === 'object') {
Object.keys(translatedFields)
g('STOQ - no cart selling plan updates needed');
}
})
.catch(error => {
console.error('STOQ - error updating cart selling plans:', error);
});
}
});
}
function storefrontGraphql(query, variables) {
const cfg = window._RestockRocketConfig;
if (!cfg.storefrontAccessToken || cfg.disableStorefrontApi === true) {
return Promise.reject(new Error('Storefront API unavailable'));
}
return fetch(
`https://${cfg.shop}/api/${cfg.storefrontApiVersion}/graphql.json`,
{
method: 'POST',
headers: {
'Content-Type': 'application/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-level metafield fetch, so it
// shares fetchStorefrontShopMetafield with the integrations/selling_plans
// reads rather than re-issuing the same query + parse.
fetchStorefrontShopMetafield('settings')
.then(function(settings) {
cfg.storefrontSettings = settings;
console.debug('STOQ - stored live settings from Storefront API on config.storefrontSettings');
})
.catch(function(e) {
console.debug('STOQ - Storefront settings fetch failed (non-fatal):', e && e.message);
});
}
if (typeof window.requestIdleCallback === 'function') {
window.requestIdleCallback(run, { timeout: 5000 });
} else {
setTimeout(run, 0);
}
})();
const cachedSettings = window._RestockRocketConfig.cachedSettings;
const validCachedSettings = cachedSettings ? checkSettingsExpiry(cachedSettings) : null;
if (validCachedSettings) {
console.debug('STOQ - using cached settings');
initializeScripts(validCachedSettings);
} else {
consol
as fallback');
initializeScripts(cachedSettings);
} else {
console.error('STOQ - failed to load settings:', error);
}
})
.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 refres
flag: 'enable_storefront_integrations_read',
isValid: function(value) { return Array.isArray(value); },
apply: function(data) {
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 = setting nfig.integrations.find(function(integration) {
return integration.type === 'hijack' && integration.enabled && integration.page_types.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 collectionScriptUrl = usePreorderBuild
? window._RestockRocketConfig.scriptUrlCollection
: window._RestockRocketConfig.scriptUrlCollectionBis;
const productScriptUrl = usePreorderBuild
? window._RestockRocketConfig.scriptUrlProduct
: window._RestockRocketConfig.scriptUrlProductBis;
const pageType = win console.debug('STOQ - dispatching app loaded event');
window.dispatchEvent(appLoadedEvent);
}
}
html.stoq-buy-now-pending .shopify-payment-button{pointer-events:none!important}