window.appBlockPlacements ||= [];
if (window.klarnaAppBlocksManager) {
window.klarnaAppBlocksManager.push({
productVariants: [{"id":44049932779746,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808891023743,"product_id":8082534826210,"position":4,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-BLACK-0_fc82bed3-0eab-49ed-94a7-f321cccc1219.jpg?v=1736263007","variant_ids":[44049932779746]},"available":true,"name":"Frog 61 - Black","public_title":"Black","options":["Black"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026111359,"position":4,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-BLACK-0_fc82bed3-0eab-49ed-94a7-f321cccc1219.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049932812514,"title":"Electric Blue","option1":"Electric Blue","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808891056511,"product_id":8082534826210,"position":5,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ELECTRICBLUE-0_4906f91c-a920-4ef6-9dc1-f0eeda6290ab.jpg?v=1736263007","variant_ids":[44049932812514]},"available":false,"name":"Frog 61 - Electric Blue","public_title":"Electric Blue","options":["Electric Blue"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026144127,"position":5,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ELECTRICBLUE-0_4906f91c-a920-4ef6-9dc1-f0eeda6290ab.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049932878050,"title":"Green","option1":"Green","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808891089279,"product_id":8082534826210,"position":6,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-GREEN-0.default_a2585bb4-683b-4938-8de0-0fe5906e24d0.jpg?v=1736263007","variant_ids":[44049932878050]},"available":true,"name":"Frog 61 - Green","public_title":"Green","options":["Green"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026176895,"position":6,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-GREEN-0.default_a2585bb4-683b-4938-8de0-0fe5906e24d0.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049932976354,"title":"Orange","option1":"Orange","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808890925439,"product_id":8082534826210,"position":2,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ORANGE-0_cec6ab92-d3f0-4ddd-a437-065b021785e8.jpg?v=1736263007","variant_ids":[44049932976354]},"available":false,"name":"Frog 61 - Orange","public_title":"Orange","options":["Orange"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026045823,"position":2,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ORANGE-0_cec6ab92-d3enshot2023-06-25at10.46.44.png?v=1687686435"},"aspect_ratio":1.307,"height":984,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/files\/Screenshot2023-06-25at10.46.44.png?v=1687686435","width":1286},{"alt":null,"id":31960255135970,"position":2,"preview_image":{"aspect_ratio":1.307,"height":984,"width":1286,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/Screenshot2023-06-25at10.46.55.png?v=1687686435"},"aspect_ratio":1.307,"height":984,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/files\/Screenshot2023-06-25at10.46.55.png?v=1687686435","width":1286}],"requires_selling_plan":false,"selling_plan_groups":[],"content":"\u003cmeta charset=\"utf-8\"\u003e\n\u003cdiv class=\"wrap-details read-more\" data-mce-fragment=\"1\"\u003e\n\u003ch3 data-mce-fragment=\"1\"\u003eDESCRIPTION\u003ci class=\"tab-arrow\" data-mce-fragment=\"1\"\u003e\u003c\/i\u003e\n\u003c\/h3\u003e\n\u003cdiv data-mce-fragment=\"1\"\u003e\n\u003cp data-mce-fragment=\"1\"\u003eDesigned to securely clip to Apidura’s Ba
f0-4ddd-a437-065b021785e8.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049933009122,"title":"Purple","option1":"Purple","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808890990975,"product_id":8082534826210,"position":3,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-PURPLE-0_c726a8e4-95ef-4000-bccf-40c4cb1e5d91.jpg?v=1736263007","variant_ids":[44049933009122]},"available":false,"name":"Frog 61 - Purple","public_title":"Purple","options":["Purple"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026078591,"position":3,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-PURPLE-0_c726a8e4-95ef-4000-bccf-40c4cb1e5d91.jpg?v=173ckcountry and Expedition Handlebar Packs, the Expedition Accessory Pocket is a useful space for storing snacks, light electronics, and documents on weekend road trips or longer bikepacking tours.\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eThe bag is built from a tough, lightweight laminate and welded at the seams to be completely waterproof, ensuring that valuables stay protected and dry. Inside, there’s an interior mesh pocket to keep the contents in order, while a bright lining makes it easy to search for individual items.\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eA light attachment point and reflective graphics have been added to the bag for enhanced safety.\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003e\u003cem data-mce-fragment=\"1\"\u003ePlease note: This bag does not function as a standalone product.\u003c\/em\u003e\u003c\/p\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"wrap-details read-more\" data-mce-fragment=\"1\"\u003e\n\u003ch3 data-mce-fragment=\"1\
- 6263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049933041890,"title":"Red","option1":"Red","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808890892671,"product_id":8082534826210,"position":1,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-RED-0_f64b6c8b-0baf-4eea-8db3-310355059fe2.jpg?v=1736263007","variant_ids":[44049933041890]},"available":true,"name":"Frog 61 - Red","public_title":"Red","options":["Red"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026013055,"position":1,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-RED-0_f64b6c8b-0baf-4eea-8db3-310355059fe2.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_al"\u003eTECHNICAL\u003ci class=\"tab-arrow\" data-mce-fragment=\"1\"\u003e\u003c\/i\u003e\n\u003c\/h3\u003e\n\u003cdiv data-mce-fragment=\"1\"\u003e\n\u003cp data-mce-fragment=\"1\"\u003e\u003cstrong data-mce-fragment=\"1\"\u003eMaterials\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eThe Expedition Accessory Pocket is cut from a three-layer laminate fabric that was developed specifically for Apidura. The material is lightweight, and is highly resistant to tears and abrasion. Notably, it’s welded together at the seams, creating a watertight seal that ensures complete waterproofing.\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003e\u003cstrong data-mce-fragment=\"1\"\u003eCare\u003c\/strong\u003e\u003c\/p\u003e\n\u003cp data-mce-fragment=\"1\"\u003eWash by hand, using a mild diluted soap if necessary. Afterwards, let it air dry.\u003cbr data-mce-fragment=\"1\"\u003eDo not machine wash, machine dry, or iron.\u003c\/p\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e"};
window._Resto
locations":[]}],
templateName: 'product',
dataKey: 'top-strip-promotion-badge',
storefrontCurrency: 'GBP',
storefrontCountry: 'GB',
storefrontLanguage: 'en',
shopLocale: 'en',
shopDomain: 'projektride.co.uk',
variantPrice: '46350',
cartPrice: '0',
selector: 'shopify-osm-Ac2tTRTlRaTI0R3BZb__klarna_on_site_messaging_app_block_8gNReH',
topPadding: '0',
bottomPadding: '0',
});
} else {
window.appBlockPlacements.push({
productVariants: [{"id":44049932779746,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808891023743,"product_id":8082534826210,"position":4,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-BLACK-0_fc82bed3-0eab-49ed-94a7-f321cccc1219.jpg?v=1736263007","variant_ids"ckRocketConfig.variantsInventoryPolicy = {44140302434530 : "continue",};
window._RestockRocketConfig.variantsInventoryQuantity = {44140302434530 : parseInt("99"),};
window._RestockRocketConfig.variantsPreorderCount = {44140302434530 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderCountForMarket = {44140302434530 : null,};
window._RestockRocketConfig.variantsPreorderMaxCount = {44140302434530 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderMaxCountForMarket = {44140302434530 : null,};
window._RestockRocketConfig.variantsShippingText = {44140302434530 : "",};
window._RestockRocketConfig.variantsShippingTextForMarket = {44140302434530 : null,};
window._RestockRocketConfig.selected_variant_id = 44140302434530;
window._RestockRocketConfig.selected_variant_available = window._RestockRocketConfig.product.variants.find(function(variant) { return variant.id == window._RestockRocketConfig.selected_variant_id }).available;window._RestockRocketConfig.scriptU:[44049932779746]},"available":true,"name":"Frog 61 - Black","public_title":"Black","options":["Black"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026111359,"position":4,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-BLACK-0_fc82bed3-0eab-49ed-94a7-f321cccc1219.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049932812514,"title":"Electric Blue","option1":"Electric Blue","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808891056511,"product_id":8082534826210,"position":5,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ELECTRICBLUE-0_4906f91c-a920-4ef6-9dc1-f0eeda6290ab.jpg?v=1736263007","variant_ids":[44049932812514]},"rlProduct = 'https://cdn.shopify.com/extensions/019b1405-52e0-7e89-a6c1-1ac7fea6dd8f/restock-rocket-shopify-410/assets/restockrocket-product.js'
window._RestockRocketConfig.scriptUrlCollection = 'https://cdn.shopify.com/extensions/019b1405-52e0-7e89-a6c1-1ac7fea6dd8f/restock-rocket-shopify-410/assets/restockrocket-collection.js'
window._RestockRocketConfig.scriptHost = window._RestockRocketConfig.scriptUrlProduct.substring(0, window._RestockRocketConfig.scriptUrlProduct.lastIndexOf('/') + 1)
window._RestockRocketConfig.host = 'https://app.restockrocket.io'
const SETTINGS_CACHE_DURATION = 15 * 60 * 1000; // 15 minutes in milliseconds
function checkSettingsExpiry(settings) {
try {
if (!settings || !settings.updated_at) {
console.debug('STOQ - Invalid settings data structure');
return null;
}
if (!settings.cache) {
console.debug('STOQ - settings caching disabled');
return null;
}
// Check if translations are enabled but missing from ProjektRide Merchandiseavailable":false,"name":"Frog 61 - Electric Blue","public_title":"Electric Blue","options":["Electric Blue"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026144127,"position":5,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ELECTRICBLUE-0_4906f91c-a920-4ef6-9dc1-f0eeda6290ab.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049932878050,"title":"Green","option1":"Green","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808891089279,"product_id":8082534826210,"position":6,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-GREEN-0.default_a2585bb4-683b-4938-8de0-0fe5906e24d0.jpg?v=1736263007","variant_ids":[44049932878050]},"avacache
// This handles the backfill period where DB has translations but metafield doesn't
if (settings.multi_language_enabled) {
if (!settings.translations) {
// Translations enabled but no translation data in metafield
// Metafield hasn't been backfilled yet - force refresh
console.debug('STOQ - multi-language enabled but no translation data in cache, fetching fresh');
return null;
}
// Translations object exists in metafield - cache is valid
// If current locale isn't translated, applyTranslations will gracefully use default locale from base fields
if (window._RestockRocketConfig.normalizedLocale &&
!Object.prototype.hasOwnProperty.call(settings.translations, window._RestockRocketConfig.normalizedLocale)) {
console.debug('STOQ - locale not explicitly translated, will use default language from cache');
}
// Don't return null - continue using cache even for untranslated locales
ilable":true,"name":"Frog 61 - Green","public_title":"Green","options":["Green"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026176895,"position":6,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-GREEN-0.default_a2585bb4-683b-4938-8de0-0fe5906e24d0.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049932976354,"title":"Orange","option1":"Orange","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808890925439,"product_id":8082534826210,"position":2,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ORANGE-0_cec6ab92-d3f0-4ddd-a437-065b021785e8.jpg?v=1736263007","variant_ids":[44049932976354]},"available":false,"name":"Frog 61 - }
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
Orange","public_title":"Orange","options":["Orange"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026045823,"position":2,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-ORANGE-0_cec6ab92-d3f0-4ddd-a437-065b021785e8.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049933009122,"title":"Purple","option1":"Purple","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808890990975,"product_id":8082534826210,"position":3,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-PURPLE-0_c726a8e4-95ef-4000-bccf-40c4cb1e5d91.jpg?v=1736263007","variant_ids":[44049933009122]},"available":false,"name":"Frog 61 - Purple","public_title":"Purple","op<
- tions":["Purple"],"price":46350,"weight":0,"compare_at_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026078591,"position":3,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-PURPLE-0_c726a8e4-95ef-4000-bccf-40c4cb1e5d91.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]},{"id":44049933041890,"title":"Red","option1":"Red","option2":null,"option3":null,"sku":"","requires_shipping":true,"taxable":true,"featured_image":{"id":72808890892671,"product_id":8082534826210,"position":1,"created_at":"2025-01-07T15:16:47+00:00","updated_at":"2025-01-07T15:16:47+00:00","alt":null,"width":1200,"height":880,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-RED-0_f64b6c8b-0baf-4eea-8db3-310355059fe2.jpg?v=1736263007","variant_ids":[44049933041890]},"available":true,"name":"Frog 61 - Red","public_title":"Red","options":["Red"],"price":46350,"weight":0,"compare_at 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')
function applyTranslations(settings) {
try {
// Skip translation logic entirely if multi-language is not enabled
if (!settings ||
_price":51500,"inventory_management":"shopify","barcode":"","featured_media":{"alt":null,"id":63810026013055,"position":1,"preview_image":{"aspect_ratio":1.364,"height":880,"width":1200,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/L-FH61_media-RED-0_f64b6c8b-0baf-4eea-8db3-310355059fe2.jpg?v=1736263007"}},"requires_selling_plan":false,"selling_plan_allocations":[]}],
templateName: 'product',
shopLocale: 'en',
dataKey: 'top-strip-promotion-badge',
storefrontCurrency: 'GBP',
storefrontCountry: 'GB',
storefrontLanguage: 'en',
shopDomain: 'projektride.co.uk',
variantPrice: '46350',
cartPrice: '0',
selector: 'shopify-osm-Ac2tTRTlRaTI0R3BZb__klarna_on_site_messaging_app_block_8gNReH',
topPadding: '0',
bottomPadding: '0',
});
}
!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) {
// No matching locale has translations; drop payload to save memory
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).forEach(function(key) {
const value = translatedFields[key];
if (value !== null && value !== undefined && value !== '') {
settings[key] = value;
}
});
} else {
console.debug('STOQ - No translated fields found for locale:', normalizedLocale);
}
delete settings.translations;
return settings;
} catch (e) {
console.debug('STOQ - error applying translations:', e);
return settings;
}
}
// First try to get settings from metafields with expiry check
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?.themHelmets
e?.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;
}
fetch(
`${window._RestockRocketConfig.host}/api/v1/setting.json?translation_locale=${window._RestockRocketConfig.normalizedLocale}`,
{ headers }
)
.then(function(response) {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(function(settings) {
initializeScripts(settings);
})
.catch(function(error) {
// If request failed and we have cache