We reserve the right to make changes to the product information contained on this site at any time without notice, including with respect to equipment, specifications, models, colours, materials and pricing. Due to supply chain issues, compatible parts may be substituted at any time without notice.
Size:Bike and frame weights are based on pre-production painted frames at time of publication. Weights may vary in final production.ML, L
Bontrager Elite Gravel, alloy, 44 cm width
[]
Size:
{"@context":"http:\/\/schema.org\/","@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3#product","@type":"ProductGroup","brand":{"@type":"Brand","name":"Trek"},"category":"Road Bikes","description":"\n\nThe Checkpoint SL 6 AXS Gen 3 is a carbon gravel bike ready for far-out adventures. Its lightweight carbon frame is designed with comfort-focused Gravel Endurance geometry, clearance for beefy 50 mm tyres (as measured), and plenty of frame and fork mounts. Plus, IsoSpeed frame technology helps soak up jarring road vibrations, so you can you float over chatter and potholes. It's ready to cut loose with a SRAM Rival AXS E1 wireless 13-speed group set.\n \n\n\n*Please note – spec applies to all sizes unless listed separately\n\nFrameset\n\n\n\nFrame\n\n\n500 Series OCLV Carbon, IsoSpeed, downtube storage door, hidden mudguard mounts, rack mounts, integrated frame bag mounts, RCS Headset System, invisible cable routing, T47, flat-mount disc, integrated chainkeeper, removable FD hanger, UDH, 142x12 mm chamfered thru axle\n\n\nFork\n\n\nTrek Checkpoint, full carbon, tapered steerer, rack mounts, fender mounts, flat mount disc, 12x100mm thru axle\n\n\n\n\n\n\n\nWeight\n\n\n\nWeight\nML - 9.49 kg \/ 20.93 lbs (with TLR sealant, no tubes)\nWeight limit\nThis bike has a maximum total weight limit (combined weight of bicycle, rider and cargo) of 125 kg (275 lb).\n\n\n\n\n\nE-system\n\n\n\nBattery\n\n\nSRAM AXS battery pack (with charger)\n\n\n\n\n\n\n\nDrivetrain\n\n\n\nRear derailleur\n\n\nSRAM Rival XPLR AXS, 46T max cog\n\n\nCassette\n\n\nSRAM Rival XPLR XG-1351, 10-46, 13-speed\n\n\nMax. chainring size\n1x:44 2x: 46\/30\n\n\n\n\n\nWheels\n\n\n\nWheel front\n\nBontrager Paradigm Comp 25, Tubeless Ready, 25 mm rim width, 100x12 mm thru axle\n\nWheel rear\n\n\nBontrager Paradigm Comp 25, Tubeless Ready, 25mm rim width, SRAM XD-R 12-speed freehub, 142x12 thru axle\n\n\nSkewer front\n\nBontrager Switch chamfered thru axle\n\nSkewer rear\n\nBontrager Switch chamfered thru axle, removable lever\n\nTyre\n\n\nBontrager Girona Pro, Tubeless Ready, GR puncture protection, aramid bead, 60 tpi, 700x42 mm\n\n\nTyre part\n\n\nBontrager TLR sealant, 180 ml\/6 oz\n\n\nRim strip\n\nBontrager TLR\n\nMax tyre size\n50 mm without mudguards, 42 mm with mudguards (as measured, see manual for details)\n\n\n\n\n\nComponents\n\n\n\nSaddle\n\nVerse Short Comp, steel rails, 145 mm width\n\nSeatpost\n\n\nBontrager carbon, 27.2 mm, 8 mm offset, 330 mm length\n\n\n*Handlebar\n\n\nSize: XS, SBontrager Elite Gravel, alloy, 40 cm width\n\n\nSize: M, MLBontrager Elite Gravel, alloy, 42 cm width\n\n\nSize: LBontrager Elite Gravel, alloy, 44 cm width\n\n\nSize: XLBontrager Elite Gravel, alloy, 46 cm width\n\n\nHandlebar tape\n\n\nBontrager Supertack Perf tape\n\n\n*Stem\n\n\nSize: XS\nBontrager Pro, 31.8 mm, Blendr-compatible, 7-degree, 70 mm length\n\n\nSize: S, M\nBontrager Pro, 31.8 mm, Blendr-compatible, 7-degree, 80mm length\n\n\nSize: ML, L\nBontrager Pro, 31.8 mm, Blendr-compatible, 7-degree, 90mm length\n\n\nSize: XL\nBontrager Pro, 31.8 mm, Blendr-compatible, 7-degree, 100mm length\n\n\nRotor size\nMax brake rotor sizes: 180 mm front and rear\n\n\n\n\n\nWe reserve the right to make changes to the product information contained on this site at any time without notice, including with respect to equipment, specifications, models, colours, materials and pricing. Due to supply chain issues, compatible parts may be substituted at any time without notice.\nBike and frame weights are based on pre-production painted frames at time of publication. Weights may vary in final production.\n\n","hasVariant":[{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717309311#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - XS \/ Dark Green\/Ivy Smoke Splatter","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717309311#offer","@type":"Offer","availability":"http:\/\/schema.org\/OutOfStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717309311"},"sku":"5334743"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717342079#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - XS \/ Era White\/Buff Beige","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717342079#offer","@type":"Offer","availability":"http:\/\/schema.org\/OutOfStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.cXLo.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717342079"},"sku":"5334749"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717374847#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - SM \/ Dark Green\/Ivy Smoke Splatter","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717374847#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717374847"},"sku":"5334744"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717407615#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - SM \/ Era White\/Buff Beige","offers":{"@id":"\/pr oducts\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717407615#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717407615"},"sku":"5334750"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717440383#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - MD \/ Dark Green\/Ivy Smoke Splatter","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717440383#offer","@type":"Offer","availability":"http:\/\/schema.org\/OutOfStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717440383"},"sku":"5334745"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717473151#variant","@type":"Product","image":"httpBontrager Elite Gravel, alloy, 46 cm widths:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - MD \/ Era White\/Buff Beige","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717473151#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717473151"},"sku":"5334751"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717505919#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - ML \/ Dark Green\/Ivy Smoke Splatter","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717505919#offer","@type":"Offer","availability":"http:\/\/schema.org\/OutOfStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717505919"},"sku":"5334746"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717538687#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - ML \/ Era White\/Buff Beige","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717538687#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717538687"},"sku":"5334752"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717571455#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - LG \/ Dark Green\/Ivy Smoke Splatter","offers":{"@id":"\/p
roducts\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717571455#offer","@type":"Offer","availability":"http:\/\/schema.org\/OutOfStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717571455"},"sku":"5334747"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717604223#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - LG \/ Era White\/Buff Beige","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717604223#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717604223"},"sku":"5334753"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717636991#variant","@type":"Product","image":"https:\/\/pr
ojektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - XL \/ Dark Green\/Ivy Smoke Splatter","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717636991#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717636991"},"sku":"5334748"},{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717669759#variant","@type":"Product","image":"https:\/\/projektride.co.uk\/cdn\/shop\/files\/CheckpointSL6AXS-26-55098-A-Primary.png?v=1764866091\u0026width=1920","name":"Trek Checkpoint SL 6 AXS Gen 3 - XL \/ Era White\/Buff Beige","offers":{"@id":"\/products\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717669759#offer","@type":"Offer","availability":"http:\/\/schema.org\/InStock","price":"3230.00","priceCurrency":"GBP","url":"https:\/\/projektride.co.uk\/prod
ucts\/trek-checkpoint-sl-6-axs-gen-3?variant=56518717669759"},"sku":"5334754"}],"name":"Trek Checkpoint SL 6 AXS Gen 3","productGroupID":"8728310579426","url":"https:\/\/projektride.co.uk\/products\/trek-checkpoint-sl-6-axs-gen-3"}
Bontrager Elite, 31.8 mm, Blendr-compatible, 7-degree, 60 mm length
I'm looking to find out more information about a product, where can I find this?Size:
SPlease get in touch with a member of the team either by phone (
01313745324
Bontrager Elite, 31.8 mm, Blendr-compatible, 7-degree, 70 mm length) or email (
[email protected]
) where on of the team will be more than happy to help.
ProjektRide Bike Shop EdinburghSize:
M, ML
I'm looking to buy this product, when will it arrive and how much does postage cost?
Bontrager Elite, 31.8 mm, Blendr-compatible, 7-degree, 80 mm length
If the item is showing in stock, we aim to post the product within 24 hours. Please allow 5 working days to receive the item.
Postage is free on orders over £50. Orders under £50, our postage charge is £3.99.Size:We also have a physical store, if you are local please pop in - ProjektRide Bike Shop EdinburghL 82 Newington Road, EH91QN, Edinburgh.
Bontrager Elite, 31.8 mm, Blendr-compatible, 7-degree, 90 mm length
We reserve the right to make changes to the product information contained on this site at any time without notice, including with respect to equipment, specifications, models, colours, materials and pricing. Due to supply chain issues, compatible parts may be substituted at any time without notice.Track Service Progress
Bike and frame weights are based on pre-production painted frames at time of publication. Weights may vary in final production.
Building Your Bike From the Box
Privacy Policy
Refund policy
Edinburgh
EH9 1QN
[email protected]
If the item is showing in stock, we aim to post the product within 24 hours. Please allow 5 working days to receive the item.
Postage is free on orders over £50. Orders under £50, our postage charge is £3.99.
We also have a physical store, if you are local please pop in -
003cp data-v-038d3ba2=\"\" class=\"mt-2 mb-1\"\u003eWe reserve the right to make changes to the product information contained on this site at any time without notice, including with respect to equipment, specifications, models, colours, materials and pricing. Due to supply chain issues, compatible parts may be substituted at any time without notice.\u003c\/p\u003e\n\u003cp data-v-038d3ba2=\"\" class=\"mb-1\"\u003eBike and frame weights are based on pre-production painted frames at time of publication. Weights may vary in final production.\u003c\/p\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e"};
window._RestockRocketConfig.variantsInventoryPolicy = {56518717309311 : "deny",56518717342079 : "deny",56518717374847 : "deny",56518717407615 : "deny",56518717440383 : "deny",56518717473151 : "deny",56518717505919 : "deny",56518717538687 : "deny",56518717571455 : "deny",56518717604223 : "deny",56518717636991 : "deny",56518717669759 : "deny",};
window._RestockRocketConfig.variantsInventoryQuantity = {565187173093
11 : parseInt("0"),56518717342079 : parseInt("0"),56518717374847 : parseInt("51"),56518717407615 : parseInt("19"),56518717440383 : parseInt("0"),56518717473151 : parseInt("51"),56518717505919 : parseInt("0"),56518717538687 : parseInt("51"),56518717571455 : parseInt("0"),56518717604223 : parseInt("51"),56518717636991 : parseInt("51"),56518717669759 : parseInt("8"),};
window._RestockRocketConfig.variantsPreorderCount = {56518717309311 : parseInt(""),56518717342079 : parseInt(""),56518717374847 : parseInt(""),56518717407615 : parseInt(""),56518717440383 : parseInt(""),56518717473151 : parseInt(""),56518717505919 : parseInt(""),56518717538687 : parseInt(""),56518717571455 : parseInt(""),56518717604223 : parseInt(""),56518717636991 : parseInt(""),56518717669759 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderCountForMarket = {56518717309311 : null,56518717342079 : null,56518717374847 : null,56518717407615 : null,56518717440383 : null,56518717473151 : null,56518717505919 : null,56518717538687 : null,56518717571455 : null,56518717604223 : null,56518717636991 : null,56518717669759 : null,};
window._RestockRocketConfig.variantsPreorderMaxCount = {56518717309311 : parseInt(""),56518717342079 : parseInt(""),56518717374847 : parseInt(""),56518717407615 : parseInt(""),56518717440383 : parseInt(""),56518717473151 : parseInt(""),56518717505919 : parseInt(""),56518717538687 : parseInt(""),56518717571455 : parseInt(""),56518717604223 : parseInt(""),56518717636991 : parseInt(""),56518717669759 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderMaxCountForMarket = {56518717309311 : null,56518717342079 : null,56518717374847 : null,56518717407615 : null,56518717440383 : null,56518717473151 : null,56518717505919 : null,56518717538687 : null,56518717571455 : null,56518717604223 : null,56518717636991 : null,56518717669759 : null,};
window._RestockRocketConfig.variantsShippingText = {56518717309311 : "",56518717342079 : "",56518717374847 : "",56518717407615 : "",56518717440383 : "",56518717473
151 : "",56518717505919 : "",56518717538687 : "",56518717571455 : "",56518717604223 : "",56518717636991 : "",56518717669759 : "",};
window._RestockRocketConfig.variantsShippingTextForMarket = {56518717309311 : null,56518717342079 : null,56518717374847 : null,56518717407615 : null,56518717440383 : null,56518717473151 : null,56518717505919 : null,56518717538687 : null,56518717571455 : null,56518717604223 : null,56518717636991 : null,56518717669759 : null,};
window._RestockRocketConfig.selected_variant_id = 56518717374847;
window._RestockRocketConfig.selected_variant_available = window._RestockRocketConfig.product.variants.find(function(variant) { return variant.id == window._RestockRocketConfig.selected_variant_id }).available;window._RestockRocketConfig.scriptUrlProduct = 'https://cdn.shopify.com/extensions/019dc114-e431-7a11-86ac-b2eb476714ae/restockrocket-1-487/assets/restockrocket-product.js'
window._RestockRocketConfig.scriptUrlCollection = 'https://cdn.shopify.com/extensions/019dc114-e431-7a
11-86ac-b2eb476714ae/restockrocket-1-487/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
const LIQUID_CACHE_MAX_AGE = 15 * 60; // 15 minutes in seconds
// Calculate Liquid cache freshness once at initialization
const liquidRenderedAt = window._RestockRocketConfig.liquidRenderedAt;
// Validate timestamp and calculate cache age
if (!liquidRenderedAt || typeof liquidRenderedAt !== 'number' || isNaN(liquidRenderedAt)) {
console.debug('STOQ - Invalid or missing liquidRenderedAt timestamp, assuming fresh');
window._RestockRocketConfig.isLiquidCacheFresh = true;
} else {
const now = Math.floor(Date.now() / 1000); // Current time in seconds
const liquidCacheAge = now - liquidRenderedAt; /
/ Age in seconds
// Handle client clock ahead of server
if (liquidCacheAge
<
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
<
= LIQUID_CACHE_MAX_AGE) {
console.debug(`STOQ - Liquid cache is fresh (${Math.round(liquidCacheAge / 60)} minutes old)`);
window._RestockRocketConfig.isLiquidCacheFresh = true;
} else {
console.debug(`STOQ - Liquid cache is stale (${Math.round(liquidCacheAge / 60)} minutes old, max ${Math.round(LIQUID_CACHE_MAX_AGE / 60)} minutes)`);
window._RestockRocketConfig.isLiquidCacheFresh = false;
}
}
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 cache
// 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
}
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')
function applyTranslations(settings) {
try {
// Skip translation logic entirely if multi-language is not enabled
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) {
// 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
&& window._RestockRocket.updateCartSellingPlans) {
window._RestockRocket.updateCartSellingPlans()
.then(hasUpdates => {
if (hasUpdates) {
console.debug('STOQ - cart selling plans updated successfully');
} else {
console.debug('STOQ - no cart selling plan updates needed');
}
})
.catch(error => {
console.error('STOQ - error updating cart selling plans:', error);
});
}
});
}
// 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.S
hopify.shop,
'ngrok-skip-browser-warning': 'skip'
};
if (window.Shopify?.theme?.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 cached 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}`);
// 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