override in assets/js/api.js. cachedSettings is populated above. Falls
// back to the build-baked host for shops without the use_render_api_host
// toggle (or environments where THEME_EXTENSION_API_HOST is unset), so the
// setting.json + fetchEmbedConfig calls below route to the same host as the
// rest of the extension's API traffic instead of staying on the baked host.
window._RestockRocketConfig.host = (window._RestockRocketConfig.cachedSettings && window._RestockRocketConfig.cachedSettings.api_host) || 'https://app.restockrocket.io'
// Deployed extension build number, read from the CDN asset host Shopify generates:
// https://cdn.shopify.com/extensions/uuid>/handle>-
version>/assets/...
// Trailing digits (e.g. ".../restockrocket-1-521/assets/" -> "521"). Kept numeric to
// match ParseStoqData, so funnel app_version lines up with the order-attribution
// app_version. Reflects the ACTUAL deployed build. This is the SINGLE source of the
// parsed version — preorder.js getAppVersion() reads it back off config rather than
// re-parsing, so the regex lives in exactly one place.
try {
const _stoqVersionMatch = window._RestockRocketConfig.scriptHost.match(/(\d+)\/?(?:assets\/?)?$/);
window._RestockRocketConfig.appVersion = (_stoqVersionMatch && _stoqVersionMatch[1]) || '';
} catch (e) {
window._RestockRocketConfig.appVersion = '';
}
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 ca<<
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 <tomer interaction.
// Detected variants: the variants present in this page's Liquid context (product page has them;
// collection/index/etc. don't expose variants from Liquid). Used to disambiguate "embed didn't
// load" vs "embed loaded but the variant wasn't a preorder/BIS candidate" in order debug.
try {
const _stoqInitConfig = window._RestockRocketConfig;
const _stoqDetectedVariantIds = (_stoqInitConfig.product && Array.isArray(_stoqInitConfig.product.variants))
? _stoqInitConfig.product.variants.map(function(v) { return v.id })
: [];
const _stoqSelectedVariantId = _stoqInitConfig.selected_variant_id;
Shopify?.analytics?.publish?.('stoq_initialized', {
cart_token: _stoqInitConfig.cartToken || '',
page_url: window.location.href,
page_type: _stoqInitConfig.pageType || '',
shop_domain: _stoqInitConfig.shop || '',
market_id: _stoqInitConfig.marketId || '',
detected_variant_ids: _stoqDetectedVariantIds,
selected_variant_id: _stoqSele
on block above) — nothing to bypass otherwise. variant_id is read per-clicked-button
// from its form so it's correct on collection/index/search too. block_accelerated_checkout
// context (STOQ-1612) rides in `properties` (forwarded verbatim by the pixel, no schema
// change): a buy_now click on a preorder variant while the gate was armed is a visible
// bypass signal for order debug. Also sends page_url (top-level, like the pixel's native
// events) and two preorder signals in properties (see below).
try {
var _sqTrack = window._RestockRocketConfig;
if (_sqTrack.preordersConfigured) {
document.addEventListener('click', function (e) {
try {
var t = e.target;
if (!t || !t.closest) return;
var host = t.closest('.shopify-payment-button, shopify-payment-terms');
if (!host) return;
var channel = host.matches && host.matches('shopify-payment-terms')
? 'shop_pay_installments' : 'buy_now';
var form = host.close
French Southern Territories (EUR€)
Gabon (XOFFr)
Gambia (GMDD)
Gibraltar (GBP£)
Greece (EUR€)
Greenland (DKKkr.)
Guernsey (GBP£)
Guinea (GNFFr)
Blog
Built for young riders navigating city streets, the Belter 16 combines a lightweight aluminum frameset with updated geometry for improved balance and control. Sliding dropouts support a clean, low-maintenance 8mm belt drivetrain, while sealed bearing wheels and grippy Schwalbe Billy Bonkers 2.0" tires offer a smooth, confident ride. With slimmer grips for smaller hands and kid-friendly gearing, it’s the perfect step up for growing cyclists ready to explore more.Mozambique (GBP£)
Track Service Progress
Building Your Bike From the Box
Namibia (GBP£)
Insure Your Bike
18714622335,56518716031359,56518716096895,56518716129663,56518716162431,56518716195199,56518716227967,56518716260735,56518716293503,56518716326271,56518716359039,56518716391807,56518716424575,56518716457343,56518716490111,56518716522879,56518716785023,56518716850559,56518716883327,56518716916095,56518716948863,56518716981631,56518717014399,56518717047167,56518717079935,56518717112703,56518717145471,56518717374847,56518717440383,56518717473151,56518717538687,56518717571455,56518717604223,56518717636991,56518717669759,56518717833599,56518717866367,56518717931903,56518717964671,56518717997439,56518718030207,56518718062975,56518718095743,56518718128511,56518718161279,56518718194047,56518790545791,56518790578559,56518790611327,56518790644095,56518790676863,56518805651839,56518805684607,56518805717375,56518805750143,56518805782911,56561153933695,56766086054271,56766086185343,56766086250879,56766086381951,56766086447487,56766086513023,56766086840703,56766183342463,56766183375231,56766183407999,56766183440767,5676618
455,57581101220223,57581101252991,57581101285759,57582419149183,57582419181951,57582419214719,57582419247487,57582419280255,57596170535295,57596170568063,57596170600831,57596170633599,57596170666367,57596170699135,57596170731903,57596170764671,57596170797439,57596170830207,57596170862975,57596170895743,57596171092351,57596171125119,57596171157887,57596171190655,57596171223423,57596171256191,57596171288959,57596171321727,57596171354495,57596171387263,57596171420031,57596171452799,57596175384959,57596175417727,57596175450495,57596175483263,57596176138623,57596176171391,57596176204159,57596176236927,57596176269695,57596176302463,57596176335231,57596176367999,57596176662911,57596176695679,57596176728447,57596176761215,57596176793983,57596176859519,57596176925055,57596177056127,57596177088895,57596177121663,57596177252735,57596177285503,57596177351039,57596177383807,57596177416575,57596177449343,57596177514879,57596177547647,57596177613183,57596177645951,57596177809791,57596177842559,57596177875327,57596177908095,Burundi (BIFFr)
2997485951,57602997518719,57602997715327,57602997879167,57602998075775,57602998206847,57602998239615,57602998337919,57602998370687,57602998403455,57602998501759,57602998534527,57602998600063,57602998894975,57602998960511,57602999026047,57602999124351,57602999157119,57602999189887,57602999222655,57603001090431,57603001123199,57603001155967,57603001188735,57603001221503,57603001254271,57603001287039,57603001647487,57603001713023,57603001745791,57603001778559,57603001844095,57603001876863,57603001942399,57603002007935,57603002040703,57603002073471,57603002106239,57603002204543,57603002237311,57603002270079,57603002302847,57603002335615,57603002368383,57603002466687,57603002499455,57603002532223,57603003089279,57603003122047,57603003154815,57603003187583,57603003220351,57603003253119,57603003285887,57603003318655,57603003351423,57603003384191,57933586399615,57933586432383,57933588693375,57933588726143,57933589676415,57933589873023,57933591314815,57933592297855,57933592330623,57933592396159,57933592461695,57933592
own_timer_custom_start_date":null,"countdown_timer_custom_end_date":null,"countdown_timer_starts_text":null,"countdown_timer_ends_text":null,"schedule_offer":false,"schedule_start_date":null,"schedule_end_date":null,"updated_at":"2025-08-19T10:05:43.042Z","allow_mixed_cart":true,"mixed_cart_error_message":"Preorders must be purchased separately from regular items. Please complete your current order first, or clear your cart to continue.","b2b_enabled":true,"preorder_progress_bar_enabled":false,"preorder_progress_bar_text":"{{ sold }} of {{ total }} claimed","preorder_progress_bar_fill_color":"#000000","preorder_progress_bar_background_color":"#e5e5e5","preorder_progress_bar_text_color":"#FFFFFF","preorder_progress_bar_border_radius":4,"preorder_progress_bar_show_percentage":false}];(function() {
const cachedData = {"plans":[{"shopify_selling_plan_group_id":98590196095,"shopify_selling_plan_id":713071886719,"enabled":true,"variant_ids":[55569712382335,55569712415103,55569712480639,55570017616255,55570017Cameroon (XAFCFA)
ing_text":"Estimated to ship within 2 months","payment_type":"full","billing_checkout_charge_type":"percentage","billing_checkout_charge_amount":null,"billing_checkout_charge_percentage":"100.0","pricing_type":"no_discount","pricing_amount":null,"pricing_percentage":null,"discount_text":"Save {{ discount }}","billing_title":"Full payment","billing_description":null,"enable_billing_widget":false,"inventory_provider":"stoq","preorder_badge_enabled":false,"preorder_badge_text":"Preorder","preorder_badge_text_color":"#FFFFFF","preorder_badge_background_color":"#000000","preorder_discounted_price_enabled":null,"payment_line_item_property_enabled":false,"shipping_line_item_property_enabled":true,"custom_line_item_property_text":null,"preorder_button_text_color":"#ffffff","preorder_button_background_color":"#565557","preorder_button_colors_enabled":true,"markets_enabled":false,"market_id":13779632354,"shopify_market_ids":[],"use_shopify_selling_plan":true,"use_simplified_shipping_text":false,"translations":{},"payme
wn_timer_use_schedule_dates":true,"countdown_timer_custom_start_date":null,"countdown_timer_custom_end_date":null,"countdown_timer_starts_text":null,"countdown_timer_ends_text":null,"schedule_offer":false,"schedule_start_date":null,"schedule_end_date":null,"updated_at":"2025-08-19T10:05:43.042Z","allow_mixed_cart":true,"mixed_cart_error_message":"Preorders must be purchased separately from regular items. Please complete your current order first, or clear your cart to continue.","b2b_enabled":true,"preorder_progress_bar_enabled":false,"preorder_progress_bar_text":"{{ sold }} of {{ total }} claimed","preorder_progress_bar_fill_color":"#000000","preorder_progress_bar_background_color":"#e5e5e5","preorder_progress_bar_text_color":"#FFFFFF","preorder_progress_bar_border_radius":4,"preorder_progress_bar_show_percentage":false}],"disabled_plan_ids":[713813721471,713176482175,714631872895],"cached_at":"2026-04-09T09:16:46Z"};
if (cachedData && typeof cachedData === 'object' && cachedData.cached_at) {
/
chedDate && !isNaN(cachedDate) && (!maxDate || cachedDate > maxDate));
if (useCached) {
if (Array.isArray(cachedData.plans)) {
window._RestockRocketConfig.sellingPlans = cachedData.plans;
// Only use disabled_plan_ids when using cached plans
window._RestockRocketConfig.disabledSellingPlanIds = cachedData.disabled_plan_ids || [];
console.debug('[RR] Using selling plans from cachedSellingPlans (cached_at: ' + cachedData.cached_at + ')');
}
} else {
// When using old format (stale cache), don't trust disabled_plan_ids
window._RestockRocketConfig.disabledSellingPlanIds = [];
console.debug('[RR] Using selling plans from old format (max updated_at: ' + maxUpdatedAt + ')');
}
}
})();window._RestockRocketConfig.enabledNotifyMeVariantIds = [];window._RestockRocketConfig.disabledNotifyMeVariantIds = [];window._RestockRocketConfig.backInStockTemplates = [];window._RestockRocketConfig.resto
road bike that brings elite racing tech to a lower price point with a more economical OCLV 500 Carbon lay-up than its SLR sibling. A SRAM Rival AXS E1 electronic group set delivers lightning-fast electronic shifting and pairs with alloy handlebars to keep the price down. Plus, it's topped off with carbon wheels for extra lightweight performance.\u003c\/p\u003e\n\u003cdiv data-v-631a2fc2=\"\" class=\"pdl-collapse\"\u003e\n\u003cp data-v-631a2fc2=\"\"\u003e*Please note – spec applies to all sizes unless listed separately\u003c\/p\u003e\n\u003cdiv data-v-631a2fc2=\"\" id=\"pdl-collapse-item-5nyfeh\" class=\"pdl-collapse-item is-active\" data-name=\"18a51468-0c8f-4798-8b6f-91c2823584c1\"\u003e\n\u003ch2 class=\"\"\u003e\u003cbutton id=\"pdl-collapse-head-5nyfeh\" class=\"pdl-collapse-item__header font-medium is-active flex-row-reverse items-center font-heading font-bold text-lg border-b-2 focusing\" type=\"button\" aria-expanded=\"true\" aria-controls=\"pdl-collapse-content-5nyfeh\" tabindex=\"0\"\u003e\u003cspCape Verde (CVE$)
-lg\" aria-label=\"Specifications\"\u003e\n\u003cdt class=\"flex-none w-full md:w-1\/5 mb-0 py-2 pr-1 font-medium border-b-2 md:border-r-2 border-gray-10\"\u003eFrame\u003c\/dt\u003e\n\u003cdd class=\"flex-none w-full md:w-4\/5 font-normal\"\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cdiv\u003e500 Series OCLV Carbon, Full System Foil tube shaping, IsoFlow seat tube, RCS Headset System, electronic or mechanical routing, removable aero chain keeper, T47 BB, flat mount disc, UDH, 142x12 mm thru axle\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/dd\u003e\n\u003cdt class=\"flex-none w-full md:w-1\/5 mb-0 py-2 pr-1 font-medium border-b-2 md:border-r-2 border-gray-10\"\u003e*Fork\u003c\/dt\u003e\n\u003cdd class=\"flex-none w-full md:w-4\/5 font-normal\"\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eXS, S, M, ML, L, XL\u003cbr\u003e\u003c\/span\u003e\n\u003cdiv\u003eMadone Gen 8 full c
k underline\"\u003eBontrager Comp, alloy, 31.8 mm, 80 mm reach, 121 mm drop, 38 cm control width, 42 cm drop width\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eML, L\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5307558\" class=\"block underline\"\u003eBontrager Comp, alloy, 31.8 mm, 80 mm reach, 121 mm drop, 40 cm control width, 44 cm drop width\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eXL\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5307559\" class=\"block underline\"\u003eBontrager Comp, alloy, 31.8 mm, 80 mm reach, 121 mm drop, 42 cm control width, 46 cm drop width\u003c\/a\u003e\n\u003c\/div\u003e\n\u003c\/dd\u003e\n\u003cdt class=\"flex-none w-full md:w-1\/5 mb-0 py-2 pr-1 font-medium border-b-2 md:border-r-2 border-gray-10\"\u003eHandlebar tape\u003c\/dt\u003e\n\u003cdd class=\"flex-none w-full md:w-4\/5 font-normal\"\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5306316\" class=\"block underline\"\u003eTrek EcoTack\u003c\/a\u003e\u003c\/div\u003e\n\u003c\/dd\u003e\n\u003cdt class=\"flex-none w-full md:w-1\/5 mb-0 py-2 pr-1 font-medium border-b-2 md:border-r-2 border-gray-10\"\u003e*Stem\u003c\/dt\u003e\n\u003cdd class=\"flex-none w-full md:w-4\/5 font-normal\"\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eXS\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5274582\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 80 mm length\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-
gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eS, M\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5274583\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 90 mm length\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eML, L\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5274584\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 100 mm length\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eXL\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5274585\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 110 mm length\u003c\/a\u003e\
n\u003c\/div\u003e\n\u003c\/dd\u003e\n\u003cdt class=\"flex-none w-full md:w-1\/5 mb-0 py-2 pr-1 font-medium border-b-2 md:border-r-2 border-gray-10\"\u003eRotor size\u003c\/dt\u003e\n\u003cdd class=\"flex-none w-full md:w-4\/5 p-2 font-normal border-b-2 border-gray-10\"\u003eMax brake rotor sizes: 180 mm front, 160 mm rear\u003c\/dd\u003e\n\u003c\/dl\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cp data-v-631a2fc2=\"\" 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-631a2fc2=\"\" 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\u003
Comoros (KMFFr)
c\/div\u003e","published_at":"2025-11-29T15:02:43+00:00","created_at":"2025-11-29T15:02:43+00:00","vendor":"Trek","type":"Bicycles","tags":["Madone","spo-cs-disabled","spo-default","spo-disabled","spo-notify-me-disabled"],"price":380000,"price_min":380000,"price_max":380000,"available":true,"price_varies":false,"compare_at_price":400000,"compare_at_price_min":400000,"compare_at_price_max":400000,"compare_at_price_varies":false,"variants":[{"id":56494085636479,"title":"XS \/ Gloss Dark Star\/Matte Deep Smoke","option1":"XS","option2":"Gloss Dark Star\/Matte Deep Smoke","option3":null,"sku":"5338008","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - XS \/ Gloss Dark Star\/Matte Deep Smoke","public_title":"XS \/ Gloss Dark Star\/Matte Deep Smoke","options":["XS","Gloss Dark Star\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085669247,"title":"XS \/ Gloss Crystal White\/Matte Deep Smoke","option1":"XS","option2":"Gloss Crystal White\/Matte Deep Smoke","option3":null,"sku":"5338999","requires_shipping":true,"taxable":true,"featured_image":null,"available":false,"name":"Trek Madone SL 6 AXS Gen 8 - XS \/ Gloss Crystal White\/Matte Deep Smoke","public_title":"XS \/ Gloss Crystal White\/Matte Deep Smoke","options":["XS","Gloss Crystal White\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085702015,"title":"S \/ Gloss Dark Star\/Matte Deep Smoke","option1":"S","option2":"Gloss Dark Star\/Matte Deep Smoke","option3":null,"sku":"5338009","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - S \/ Gloss Dark Star\/M
atte Deep Smoke","public_title":"S \/ Gloss Dark Star\/Matte Deep Smoke","options":["S","Gloss Dark Star\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085734783,"title":"S \/ Gloss Crystal White\/Matte Deep Smoke","option1":"S","option2":"Gloss Crystal White\/Matte Deep Smoke","option3":null,"sku":"5339000","requires_shipping":true,"taxable":true,"featured_image":null,"available":false,"name":"Trek Madone SL 6 AXS Gen 8 - S \/ Gloss Crystal White\/Matte Deep Smoke","public_title":"S \/ Gloss Crystal White\/Matte Deep Smoke","options":["S","Gloss Crystal White\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085767551,"title":"M \/ Gloss Dark Star\/Matte Deep Smoke","option1":"M","option2":"Gloss Dark Star\/Matte Deep Smoke","option3":null,"sku":"5338010","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - M \/ Gloss Dark Star\/Matte Deep Smoke","public_title":"M \/ Gloss Dark Star\/Matte Deep Smoke","options":["M","Gloss Dark Star\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085800319,"title":"M \/ Gloss Crystal White\/Matte Deep Smoke","option1":"M","option2":"Gloss Crystal White\/Matte Deep Smoke","option3":null,"sku":"5339001","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - M \/ Gloss Crystal White\/Matte Deep Smoke","public_title":"M \/ Gloss Crystal White\/Matte Deep Smoke","options":["M","Gloss Cryst
al White\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085833087,"title":"ML \/ Gloss Dark Star\/Matte Deep Smoke","option1":"ML","option2":"Gloss Dark Star\/Matte Deep Smoke","option3":null,"sku":"5338011","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - ML \/ Gloss Dark Star\/Matte Deep Smoke","public_title":"ML \/ Gloss Dark Star\/Matte Deep Smoke","options":["ML","Gloss Dark Star\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085865855,"title":"ML \/ Gloss Crystal White\/Matte Deep Smoke","option1":"ML","option2":"Gloss Crystal White\/Matte Deep Smoke","option3":null,"sku":"5339002","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - ML \/ Gloss Crystal White\/Matte Deep Smoke","public_title":"ML \/ Gloss Crystal White\/Matte Deep Smoke","options":["ML","Gloss Crystal White\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085898623,"title":"L \/ Gloss Dark Star\/Matte Deep Smoke","option1":"L","option2":"Gloss Dark Star\/Matte Deep Smoke","option3":null,"sku":"5338012","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - L \/ Gloss Dark Star\/Matte Deep Smoke","public_title":"L \/ Gloss Dark Star\/Matte Deep Smoke","options":["L","Gloss Dark Star\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"sh
opify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085931391,"title":"L \/ Gloss Crystal White\/Matte Deep Smoke","option1":"L","option2":"Gloss Crystal White\/Matte Deep Smoke","option3":null,"sku":"5339003","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"Trek Madone SL 6 AXS Gen 8 - L \/ Gloss Crystal White\/Matte Deep Smoke","public_title":"L \/ Gloss Crystal White\/Matte Deep Smoke","options":["L","Gloss Crystal White\/Matte Deep Smoke"],"price":380000,"weight":0,"compare_at_price":400000,"inventory_management":"shopify","barcode":null,"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":56494085964159,"title":"XL \/ Gloss Dark Star\/Matte Deep Smoke","option1":"XL","option2":"Gloss Dark Star\/Matte Deep Smoke","option3":null,"sku":"5338013","requires_shipping":true,"taxable":true,"featured_image":null,"availab
.com\/b2b\/gb\/en_GB\/p\/5274583\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 90 mm length\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eML, L\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5274584\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 100 mm length\u003c\/a\u003e\n\u003c\/div\u003e\n\u003cdiv class=\"p-2 border-b-2 border-gray-10\"\u003e\n\u003cspan\u003eSize:\u003c\/span\u003e\u003cspan\u003e \u003c\/span\u003e\u003cspan\u003eXL\u003cbr\u003e\u003c\/span\u003e\u003ca href=\"https:\/\/www.trekbikes.com\/b2b\/gb\/en_GB\/p\/5274585\" class=\"block underline\"\u003eTrek RCS Pro, -7-degree, 110 mm length\u003c\/a\u003e\n\u003c\/div\u003e\n\u003c\/dd\u003e\n\u003cdt class=\"flex-none w-full md:w-1\/5 mb-0 py-2 pr-1 font-medium border-b-2 md:border-r-2 border-gray-10\"\u003eRotor size\u003c\/dt\u003e
\n\u003cdd class=\"flex-none w-full md:w-4\/5 p-2 font-normal border-b-2 border-gray-10\"\u003eMax brake rotor sizes: 180 mm front, 160 mm rear\u003c\/dd\u003e\n\u003c\/dl\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003c\/div\u003e\n\u003cp data-v-631a2fc2=\"\" 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-631a2fc2=\"\" 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 = {56494085636479 : "deny",56494085669247 : "deny",56494085702015 : "deny",56494085734783 : "deny",56494085767551 : "deny",56494085800319 : "deny",56494085833087 : "deny",56494085865855 : "deny",56494085898623 : "deny",56494085931391 : "deny",56494085964159 : "deny",56494085996927 : "deny",};
window._RestockRocketConfig.variantsInventoryQuantity = {56494085636479 : parseInt("2"),56494085669247 : parseInt("0"),56494085702015 : parseInt("51"),56494085734783 : parseInt("0"),56494085767551 : parseInt("51"),56494085800319 : parseInt("5"),56494085833087 : parseInt("51"),56494085865855 : parseInt("7"),56494085898623 : parseInt("51"),56494085931391 : parseInt("1"),56494085964159 : parseInt("51"),56494085996927 : parseInt("1"),};
window._RestockRocketConfig.variantsPreorderCount = {56494085636479 : parseInt(""),56494085669247 : parseInt(""),56494085702015 : parseInt(""),56494085734783 : parseInt(""),56494085767551 : parseInt(""),56494085800319 : parseInt(""),56494085833087 : parseInt(""),56494085865855 : parseInt(""),56494085898623 : parseInt(""),56494085931391 : parseInt(""),56494085964159 : parseInt(""),564940859969
27 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderCountForMarket = {56494085636479 : null,56494085669247 : null,56494085702015 : null,56494085734783 : null,56494085767551 : null,56494085800319 : null,56494085833087 : null,56494085865855 : null,56494085898623 : null,56494085931391 : null,56494085964159 : null,56494085996927 : null,};
window._RestockRocketConfig.variantsPreorderMaxCount = {56494085636479 : parseInt(""),56494085669247 : parseInt(""),56494085702015 : parseInt(""),56494085734783 : parseInt(""),56494085767551 : parseInt(""),56494085800319 : parseInt(""),56494085833087 : parseInt(""),56494085865855 : parseInt(""),56494085898623 : parseInt(""),56494085931391 : parseInt(""),56494085964159 : parseInt(""),56494085996927 : parseInt(""),};
window._RestockRocketConfig.variantsPreorderMaxCountForMarket = {56494085636479 : null,56494085669247 : null,56494085702015 : null,56494085734783 : null,56494085767551 : null,56494085800319 : null,56494085833087 : null,56494085865855 : null,56
494085898623 : null,56494085931391 : null,56494085964159 : null,56494085996927 : null,};
window._RestockRocketConfig.variantsShippingText = {56494085636479 : "",56494085669247 : "",56494085702015 : "",56494085734783 : "",56494085767551 : "",56494085800319 : "",56494085833087 : "",56494085865855 : "",56494085898623 : "",56494085931391 : "",56494085964159 : "",56494085996927 : "",};
window._RestockRocketConfig.variantsShippingTextForMarket = {56494085636479 : null,56494085669247 : null,56494085702015 : null,56494085734783 : null,56494085767551 : null,56494085800319 : null,56494085833087 : null,56494085865855 : null,56494085898623 : null,56494085931391 : null,56494085964159 : null,56494085996927 : null,};
window._RestockRocketConfig.selected_variant_id = 56494085636479;
window._RestockRocketConfig.selected_variant_available = window._RestockRocketConfig.product.variants.find(function(variant) { return variant.id == window._RestockRocketConfig.selected_variant_id }).available;// STOQ-1595/1612 sha
red signal, derived once here so both the accelerated-checkout block
// gate (STOQ-1612) and the click tracker (STOQ-1595) read one clearly-owned flag rather
// than a side effect buried in either consumer's try/catch: whether this shop has preorders
// configured at all — an enabled selling plan plus at least one preorder variant id,
// independent of the block toggle. Fail-open: on error the flag stays unset and both
// consumers no-op.
try {
var _sqCfg = window._RestockRocketConfig;
var _sqPlanEnabled = Array.isArray(_sqCfg.sellingPlans) &&
_sqCfg.sellingPlans.some(function (p) { return p && p.enabled; });
var _sqPreCount = ((_sqCfg.cachedPreorderVariantIds &&
_sqCfg.cachedPreorderVariantIds.preorder_variant_ids) || []).length;
_sqCfg.preordersConfigured = !!(_sqPlanEnabled && _sqPreCount);
} catch (e) { /* fail open */ }
// STOQ-1612: block (not hide) Buy Now / Shop Pay until our JS runs, so a tap in the
// load window can't bypass preorder. pointer-events via .stoq-buy-now-pending (no
// reflow); timeout releases; renderPreorderButton / featured_product.js lift it.
// Gated by the `block_accelerated_checkout` toggle (default OFF) for gradual rollout.
// Armed ONLY when we're sure preorder is in play — product page: THIS product has a
// preorder variant (never block a plain product's Shop Pay); featured: integration
// enabled for this page type. Rationale: PR #2784.
try {
var _sqc = window._RestockRocketConfig;
var _sqOn = !!(_sqc.cachedSettings && _sqc.cachedSettings.block_accelerated_checkout);
var _sqPre = (_sqc.cachedPreorderVariantIds &&
_sqc.cachedPreorderVariantIds.preorder_variant_ids) || [];
var _sqArm = false;
if (_sqOn && _sqc.preordersConfigured) {
if (_sqc.pageType === 'product' && _sqc.product && _sqc.product.variants) {
_sqArm = _sqc.product.variants.some(function (v) { return _sqPre.indexOf(Number(v.id)) !== -1; });
} else {
_sqArm = (_sqc.integrations || []).some(function (i)
Cyprus (EUR€)
{
return i && i.type === 'featured_product' && i.enabled &&
Array.isArray(i.page_types) && i.page_types.indexOf(_sqc.pageType) !== -1;
});
}
}
if (_sqArm && document.documentElement) {
_sqc.acceleratedGateArmed = true;
document.documentElement.classList.add('stoq-buy-now-pending');
setTimeout(function () {
document.documentElement.classList.remove('stoq-buy-now-pending');
}, 6000);
}
} catch (e) { /* fail open */ }
window._RestockRocketConfig.scriptUrlProduct = 'https://cdn.shopify.com/extensions/019f37a7-f058-7bcb-a02d-3fb0b8a7522a/restockrocket-1-539/assets/restockrocket-product.js'
window._RestockRocketConfig.scriptUrlCollection = 'https://cdn.shopify.com/extensions/019f37a7-f058-7bcb-a02d-3fb0b8a7522a/restockrocket-1-539/assets/restockrocket-collection.js'
window._RestockRocketConfig.scriptUrlProductBis = 'https://cdn.shopify.com/extensions/019f37a7-f058-7bcb-a02d-3fb0b8a7522a/restockrocket-1-539/assets/restockrocket-product-bis.js'
window._RestockRocketConfig.scriptUrlCollectionBis = 'https://cdn.shopify.com/extensions/019f37a7-f058-7bcb-a02d-3fb0b8a7522a/restockrocket-1-539/assets/restockrocket-collection-bis.js'
window._RestockRocketConfig.scriptHost = window._RestockRocketConfig.scriptUrlProduct.substring(0, window._RestockRocketConfig.scriptUrlProduct.lastIndexOf('/') + 1)
// Canary override (STOQ-1287): prefer the Render host emitted into the
// metafield-cached settings (api_host) when present, mirroring the same
// override in assets/js/api.js. cachedSettings is populated above. Falls
// back to the build-baked host for shops without the use_render_api_host
// toggle (or environments where THEME_EXTENSION_API_HOST is unset), so the
// setting.json + fetchEmbedConfig calls below route to the same host as the
// rest of the extension's API traffic instead of staying on the baked host.
window._RestockRocketConfig.host = (window._RestockRocketConfig.cachedSettings && window._RestockRocketConfig.ca
chedSettings.api_host) || 'https://app.restockrocket.io'
// Deployed extension build number, read from the CDN asset host Shopify generates:
// https://cdn.shopify.com/extensions/<
uuid>/
<
handle>-<
Czechia (CZKKč)
version>/assets/...
// Trailing digits (e.g. ".../restockrocket-1-521/assets/" -> "521"). Kept numeric to
// match ParseStoqData, so funnel app_version lines up with the order-attribution
// app_version. Reflects the ACTUAL deployed build. This is the SINGLE source of the
// parsed version — preorder.js getAppVersion() reads it back off config rather than
// re-parsing, so the regex lives in exactly one place.
try {
const _stoqVersionMatch = window._RestockRocketConfig.scriptHost.match(/(\d+)\/?(?:assets\/?)?$/);
window._RestockRocketConfig.appVersion = (_stoqVersionMatch && _stoqVersionMatch[1]) || '';
} catch (e) {
window._RestockRocketConfig.appVersion = '';
}
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 ca
che age
if (!liquidRenderedAt || typeof liquidRenderedAt !== 'number' || isNaN(liquidRenderedAt)) {
console.debug('STOQ - Invalid or missing liquidRenderedAt timestamp, assuming fresh');
window._RestockRocketConfig.isLiquidCacheFresh = true;
window._RestockRocketConfig.liquidCacheAge = null;
} else {
const now = Math.floor(Date.now() / 1000); // Current time in seconds
const liquidCacheAge = now - liquidRenderedAt; // Age in seconds
// Surfaced into funnel events: a stale cache means the app rendered with
// outdated inventory/selling-plan data — a real "had the opportunity but
// failed" cause. Negative (client clock ahead) clamps to 0.
window._RestockRocketConfig.liquidCacheAge = Math.max(0, liquidCacheAge);
// 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
<
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
tomer interaction.
// Detected variants: the variants present in this page's Liquid context (product page has them;
// collection/index/etc. don't expose variants from Liquid). Used to disambiguate "embed didn't
// load" vs "embed loaded but the variant wasn't a preorder/BIS candidate" in order debug.
try {
const _stoqInitConfig = window._RestockRocketConfig;
const _stoqDetectedVariantIds = (_stoqInitConfig.product && Array.isArray(_stoqInitConfig.product.variants))
? _stoqInitConfig.product.variants.map(function(v) { return v.id })
: [];
const _stoqSelectedVariantId = _stoqInitConfig.selected_variant_id;
Shopify?.analytics?.publish?.('stoq_initialized', {
cart_token: _stoqInitConfig.cartToken || '',
page_url: window.location.href,
page_type: _stoqInitConfig.pageType || '',
shop_domain: _stoqInitConfig.shop || '',
market_id: _stoqInitConfig.marketId || '',
detected_variant_ids: _stoqDetectedVariantIds,
selected_variant_id: _stoqSele
on block above) — nothing to bypass otherwise. variant_id is read per-clicked-button
// from its form so it's correct on collection/index/search too. block_accelerated_checkout
// context (STOQ-1612) rides in `properties` (forwarded verbatim by the pixel, no schema
// change): a buy_now click on a preorder variant while the gate was armed is a visible
// bypass signal for order debug. Also sends page_url (top-level, like the pixel's native
// events) and two preorder signals in properties (see below).
try {
var _sqTrack = window._RestockRocketConfig;
if (_sqTrack.preordersConfigured) {
document.addEventListener('click', function (e) {
try {
var t = e.target;
if (!t || !t.closest) return;
var host = t.closest('.shopify-payment-button, shopify-payment-terms');
if (!host) return;
var channel = host.matches && host.matches('shopify-payment-terms')
? 'shop_pay_installments' : 'buy_now';
var form = host.close
ack.product && _sqTrack.product.id) || '',
channel: channel,
market_id: _sqTrack.marketId || '',
page_type: _sqTrack.pageType || '',
cart_token: _sqTrack.cartToken || '',
page_url: (window.location && window.location.href) || '',
properties: {
// Mirror the bundle's own preorder check (preorder.js checkInventoryProvider-
// WithCachedFallback): the live set config.preorderVariantIds (refreshed after
// page load by loadVariantInventoryData) OR the Liquid-injected
// cachedPreorderVariantIds — always present, so it covers clicks before the
// bundle loads (why this tracker is inline). ORing both (not preferring one)
// matches the bundle and is correct even if the live set is an empty array. Both
// hold integer ids; the click-time id comes off a DOM input (.value → string) or
// selected_variant_id, so coerce with Number for
er bypass is detectable too.
is_instock_variant: (function () {
var has = function (a) { return Array.isArray(a) && a.indexOf(_sqVidNum) !== -1; };
return has(_sqTrack.inStockVariantIds) ||
has(_sqTrack.cachedInStockVariantIds &&
_sqTrack.cachedInStockVariantIds.in_stock_variant_ids);
})(),
// The enrolled plan's Shopify selling-plan id + inventory_provider (stoq = STOQ tracks
// the OOS count; shopify = in-stock preorder). Tells order-debug what kind of preorder
// the Buy Now bypassed, without a downstream lookup.
enrolled_plan_id: (_sqPlan && (_sqPlan.shopify_selling_plan_id || _sqPlan.shopify_selling_plan_group_id)) || '',
enrolled_plan_provider: (_sqPlan && _sqPlan.inventory_provider) || '',
block_enabled: !!(_sqTrack.cachedSettings && _sqTrack.cachedSettings.block_accelerated_checkout),
gate_armed: !!_sqTrack.aDjibouti (DJFFdj)
);
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
func
ditive, does not gate init) ----
// The inlined `cachedSettings` comes from the app-embed Liquid render, which
// Shopify edge-caches and can serve stale. Reading the same `settings` metafield
// back over the Storefront API is a POST to /api/
version>/graphql.json — never
// CDN-cached — so it returns the live value on every page load. We fetch it
// best-effort and stash it on `window._RestockRocketConfig.storefrontSettings`
// so individual behaviours can migrate onto the fresh value over time. This is
// PURELY ADDITIVE: it does NOT change the resolution flow below, never blocks
// init, and silently no-ops on any failure / missing token.
(function loadStorefrontSettings() {
const cfg = window._RestockRocketConfig;
if (!cfg.storefrontAccessToken || cfg.disableStorefrontApi === true) return;
// Deferred to browser idle so this best-effort read runs strictly AFTER the
// critical init flow and never competes with it for a connection — the call
// is a live, uncached Storefront round-trip and can be slow (multi-second
// TTFB observed). Nothing on the critical path waits for it.
function run() {
const query = 'query StoqSettings($namespace: String!) { shop { metafield(namespace: $namespace, key:
refrontSettings = JSON.parse(value);
console.debug('STOQ - stored live settings from Storefront API on config.storefrontSettings');
})
.catch(function(e) {
console.debug('STOQ - Storefront settings fetch failed (non-fatal):', e && e.message);
});
}
if (typeof window.requestIdleCallback === 'function') {
window.requestIdleCallback(run, { timeout: 5000 });
} else {
setTimeout(run, 0);
}
})();
// FEgypt (EGPج.م)
{ 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 fetchEmbedConfig(endpoint, apply) {
return fetch(
`${window._RestockRocketConfig.host}/api/v1/embed/${endpoint}.json`,
{
headers: {
'X-Shopify-Shop-Domain': window._RestockRocketConfig.shop || window.Shopify.shop,
'ngrok-skip-browser-warning': 'skip'
}
}
)
.then(function(r
hop opt-out via the
// `disable_refresh_on_stale_liquid` Toggle, surfaced as the negative
// `disable_refresh_on_stale_liquid` flag in settings.json so that
// `undefined` -- in CDN-cached metafield payloads that predate this
// key -- reads as `!undefined === true` and gets default-on behavior
// immediately, no metafield rewrite required).
// When the Liquid CDN cache is older than LIQUID_CACHE_MAX_AGE the in-page
// selling_plans / integrations metafields can be wrong; refresh both from
// the API before launching scripts. Race against a 1000ms timeout so a slow
// API can't block init indefinitely. If the timeout wins, the in-flight
// fetches still complete and update window._RestockRocketConfig — the
// bundle re-reads sellingPlans/integrations on every interaction, so the
// late-arriving values benefit subsequent renders even though the first
// paint may use the Liquid-cached values. On any failure the existing
// Liquid-loaded values stay in
n 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);
})
// STOQ-1520: serve the lean back-in-stock-only build (no preorder/hijack code)
// only to shops with NO preorder plans. Use the full build if preorder is on,
// an enabled offer exists, or a disabled-but-kept plan id remains (cart sweep
// must still strip those). Rationale in the PR.
const hasEnabledOffer = Array.isArray(window._RestockRocketConfig.sellingPlans)
&& window._RestockRocketConfig.sellingPlans.some(function(plan) { return plan && plan.enabled; });
const hasDisabledPlanIds = Array.isArray(window._RestockRocketConfig.disabledSellingPlanIds)
&& window._RestockRocke
ection);
} else if(usePreorderBuild) {
// cart/article/blog/list-collections: full build so the cart sweep runs.
createRestockRocketScript(window._RestockRocketConfig.scriptUrlCollection);
} else {
console.debug(`STOQ - no scripts enabled for ${pageType}`);
}
// Dispatch custom event when app is loaded
// Cart selling plan updates will be triggered by stoq:inventory-data-loaded event
const appLoadedEvent = new CustomEvent('stoq:loaded', {
detail: {
pageType: window._RestockRocketConfig.pageType,
enabled: settings.enable_app,
settings: settings,
preorderEnabled: settings.preorder_enabled
}
});
console.debug('STOQ - dispatching app loaded event');
window.dispatchEvent(appLoadedEvent);
}
}
Equatorial Guinea (XAFCFA)