Bottles and Cages
Quantity:
ght":3264,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/files\/DSC05199.jpg?v=1726396648","width":4912},{"alt":null,"id":34646331752674,"position":4,"preview_image":{"aspect_ratio":1.505,"height":3264,"width":4912,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/DSC05195.jpg?v=1726396648"},"aspect_ratio":1.505,"height":3264,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/files\/DSC05195.jpg?v=1726396648","width":4912},{"alt":null,"id":34646331785442,"position":5,"preview_image":{"aspect_ratio":1.505,"height":3264,"width":4912,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/DSC05192.jpg?v=1726396649"},"aspect_ratio":1.505,"height":3264,"media_type":"image","src":"\/\/projektride.co.uk\/cdn\/shop\/files\/DSC05192.jpg?v=1726396649","width":4912},{"alt":null,"id":34646331818210,"position":6,"preview_image":{"aspect_ratio":1.505,"height":3264,"width":4912,"src":"\/\/projektride.co.uk\/cdn\/shop\/files\/DSC05191.jpg?v=1726396648"},"aspect_ratio":1.505,"height":3264,"media_type":"image", 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.
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');
initializeScrcached settings (even if expired), use them as fallback
if (cachedSettings) {
console.debug('STOQ - using expired cached settings as fallback');
initializeScripts(cachedSettings);
} 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}`);
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)) {
img src="//projektride.co.uk/cdn/shop/files/DSC05191_98x.jpg?v=1726396648" alt="" class="product-single__thumbnail-img">
