const storefrontRead = window._RestockRocketConfig.readFlags?.enable_storefront_settings_read === true
? Promise.race([
fetchStorefrontSettings(),
new Promise(function(_, reject) { setTimeout(function() { reject(new Error('timed out')); }, 1500); })
]).catch(function(error) {
console.debug('STOQ - Storefront settings read failed, using setting.json:', error.message);
})
: Promise.resolve();
storefrontRead
.then(function(settings) {
return settings || 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 (cachedSettings) {
console.de
About Us
Forms|setupAddToCartForm|teardownAddToCartForm|addDiscountedPrice|removeDiscountedPrice)\b/.test(settings.js_config || '');
const preorderCollectionScriptUrl = preorderUiOnPage
? window._RestockRocketConfig.scriptUrlCollectionFull
: window._RestockRocketConfig.scriptUrlCollection;
const collectionScriptUrl = usePreorderBuild
? preorderCollectionScriptUrl
: window._RestockRocketConfig.scriptUrlCollectionBis;
const productScriptUrl = usePreorderBuild
? window._RestockRocketConfig.scriptUrlProduct
: window._RestockRocketConfig.scriptUrlProductBis;
const collectionPageTypes = ['collection', 'index', 'search', 'page'];
if(collectionPageTypes.indexOf(pageType) !== -1 && (settings[`show_button_on_${pageType}`] || settings[`preorder_${pageType}_enabled`])) {
createRestockRocketScript(collectionScriptUrl);
} else if(pageType === 'product') {
createRestockRocketScript(productScriptUrl);
} else if(hijackIntegratioSell Your BikeContact Us
Contact UsBlog
Electric Mountain Bikes
Electric Hybrid Bikes
Electric Folding Bikes




Egypt (EGPج.م)
Ethiopia (ETBBr)
Gabon (XOFFr)
izeScripts(settings) {
settings = applyTranslations(settings);
window._RestockRocketConfig.settings = settings;
console.debug(`STOQ - settings configured for ${window._RestockRocketConfig.pageType}`);
const staleRefresh = !window._RestockRocketConfig.isLiquidCacheFresh && !settings.disable_refresh_on_stale_liquid;
if (staleRefresh) {
console.debug('STOQ - refreshing selling_plans + integrations (Liquid cache stale)');
Promise.race([
Promise.all([refreshSellingPlans(), refreshIntegrations()]),
new Promise(function(resolve) { setTimeout(resolve, 1000); })
]).then(function() { loadScripts(settings); });
return;
}
loadScripts(settings);
}
function loadScripts(settings) {
setupCartSellingPlanUpdater(settings);
if(settings.enable_app) {
const hijackIntegration = window._RestockRocketConfig.integrations.find(function(integration) {
return integration.type === 'hijack' && integration.enabled && integration.page_types.incl
Velduro
Argon 18











