Header Image

  • Armenia (AMDդր.)
  • Ascension Island (SHP£)
  • Austria (EUR€)
  • Belarus (GBP£)
  • Belgium (EUR€)
  • Benin (XOFFr)
  • Bosnia & Herzegovina (BAMКМ)
  • Botswana (BWPP)
  • British Indian Ocean Territory (USD$)
704 productsBulgaria (EUR€)
Burkina Faso (XOFFr)
  • Chad (XAFCFA)
  • Comoros (KMFFr)
  • Congo - Brazzaville (XAFCFA)
  • Congo - Kinshasa (CDFFr)
  • Côte d’Ivoire (XOFFr)
  • Croatia (EUR€)
  • Cyprus (EUR€)
  • Czechia (CZKKč)
  • Denmark (DKKkr.)
Djibouti (DJFFdj)
Equatorial Guinea (XAFCFA)
  • Eritrea (GBP£)
     
    Estonia (EUR€)
     
    Eswatini (GBP£)
     
    Ethiopia (ETBBr)
    Faroe Islands (DKKkr.) £
    £France (EUR€) French Southern Territories (EUR€)
Gabon (XOFFr)
Georgia (GBP£)
    • Kenya (KESKSh)
    • Kosovo (EUR€)
    • Latvia (EUR€)
    • Lesotho (GBP£)
    • Liberia (GBP£)
    • Libya (GBP£)
    • Liechtenstein (CHFCHF)
    • Lithuania (EUR€)
    • Luxembourg (EUR€)
    • Madagascar (GBP£)
    • Malawi (MWKMK)
    • Mali (XOFFr)
    • Malta (EUR€)
    • Mauritania (GBP£)
    • Mauritius (MUR₨)
    • Mayotte (EUR€)
    • Moldova (MDLL)
    • Monaco (EUR€)
    • Montenegro (EUR€)
    • Morocco (MADد.م.)
    • Mozambique (GBP£)
    Namibia (GBP£)
Niger (XOFFr)
North Macedonia (MKDден)
    • Maestro
    • Mastercard
    • PayPal
    • Shop Pay
    • Close
    • < 0) { console.debug(`STOQ - Client clock appears ahead of server by ${Math.abs(Math.round(liquidCacheAge / 60))} minutes, assuming cache fresh`); window._RestockRocketConfig.isLiquidCacheFresh = true; } else if (liquidCacheAge
    • 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 } 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.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; } } // Setup event listener for cart selling plan updates // This must be called before any scripts are loaded to avoid race conditions function setupCartSellingPlanUpdater(settings) { // Setup listener regardless - updateCartSellingPlans has its own guards // This ensures cleanup happens even when preorders are disabled globally // Listen for stoq:inventory-data-loaded event dispatched by api.js window.addEventListener('stoq:inventory-data-loaded', function(event) { console.debug('STOQ - Inventory data loaded, updating cart selling plans'); if (window._RestockRocket
    • hedSettings); } else { console.error('STOQ - failed to load settings:', error); } }) .catch(function(e) { console.error(e) }) } function initializeScripts(settings) { settings = applyTranslations(settings); window._RestockRocketConfig.settings = settings; console.debug(`STOQ - settings configured for ${window._RestockRocketConfig.pageType}`); // Setup cart selling plan updater BEFORE loading any scripts to avoid race conditions setupCartSellingPlanUpdater(settings); if(settings.enable_app) { const hijackIntegration = window._RestockRocketConfig.integrations.find(function(integration) { return integration.type === 'hijack' && integration.enabled && integration.page_types.includes(window._RestockRocketConfig.pageType); }) if(window._RestockRocketConfig.pageType === 'collection' && (settings.show_button_on_collection || settings.preorder_collection_enabled)) { createRestockRocketScript(window._RestockRocketCon fig.scriptUrlCollection); } else if(window._RestockRocketConfig.pageType === 'index' && (settings.show_button_on_index || settings.preorder_index_enabled)) { createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection); } else if(window._RestockRocketConfig.pageType === 'search' && (settings.show_button_on_search || settings.preorder_search_enabled)) { createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection); } else if(window._RestockRocketConfig.pageType === 'page' && (settings.show_button_on_page || settings.preorder_page_enabled)) { createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection); } else if(window._RestockRocketConfig.pageType === 'product') { createRestockRocketScript(window._RestockRocketConfig.scriptUrlProduct); } else if(hijackIntegration) { createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection); } else { console.debug(`STOQ - no scripts enab