You’ve moved a project to Storefront Next. The React app renders, the product pages load, and then someone in the team chat asks the awkward question: “Is our calculate hook still running, or did we just migrate it into the void?” Nobody is sure. Somebody remembers a cartridge that nobody wants to touch, and a nightly job that sends orders to the ERP. Do they still work? Where do they even live now?
The short answer: the SFCC instance is still the backend. Storefront Next is a separate frontend that talks to it over APIs. Most of what you built on the server side stays exactly where it is. This post walks through what stays, what is new, and how the bridge between the two works.
A few definitions first, because I’ll use them throughout:
- Cartridge: SFCC’s packaging unit for code, templates, and metadata. A site only uses a cartridge if it is listed on that site’s cartridge path, an ordered list of cartridge names set in Business Manager.
- Script hook: a function registered through
hooks.json(the cartridge’spackage.jsonpoints to it) that the platform calls at a defined extension point, for example when a basket is calculated. - Job: a scheduled or manually started process in Business Manager, built from job steps.
- Site preference: a configurable value, defined as a custom attribute on the
SitePreferencessystem object type and edited per site in Business Manager. - SCAPI and OCAPI: the Salesforce Commerce API and the older Open Commerce API. Both are HTTP APIs that expose shopper and admin data from the instance. Storefront Next calls SCAPI.
- MRT (Managed Runtime): Salesforce’s hosting environment where the Storefront Next app runs, separate from the SFCC instance.
Note
Scope: This post covers the backend boundary. For the bigger picture of the move away from PWA Kit, see Storefront Next: Architecture and the PWA Kit Migration.
Two Halves, One Instance
The frontend has moved out of the instance; everything behind the API stays put. The storefront talks to SCAPI; SCAPI talks to the platform; the platform runs your cartridges, hooks, and jobs.
Nothing about your Business Manager, your catalogue, your promotions, or your order management has moved. What went away, for every route Storefront Next serves, is the controller-and-ISML rendering layer (controllers handled requests, and ISML templates produced the HTML in SFRA). In a hybrid setup, routes you list in legacyRoutes, such as /cart and /checkout, still render through SFRA or SiteGenesis, per the hybrid guide. Everything that was never about rendering stays where it was, although how the storefront reaches it has changed.
The app_storefrontnext_base Cartridge
The Storefront Next project carries one cartridge of its own: cartridges/app_storefrontnext_base. Per the Page Designer deployment guide, its documented job is to carry the Page Designer metadata to the instance. You generate and deploy it with pnpm cartridge:generate and pnpm cartridge:deploy, and the GitHub setup action deploys it for you. Page Designer setup is a classic source of confusion (missing roles and scopes, plus a separate Local Dev cartridge that is a downloadable ZIP and not this one); the Page Designer troubleshooting guide covers those.
Think of it as a metadata cartridge, not as a new SFRA. The generated output is JSON under cartridge/experience/ (components, pages, aspects), and nothing I found describes it as holding hook scripts or controllers. Like any cartridge, it only counts once it is on the site’s cartridge path: the Page Designer integration guide tells you to add app_storefrontnext_base under Administration > Sites > Manage Sites > [your site] > Settings. If you need server-side logic, that is what your own cartridges are for.
Which Script Hooks Still Run
A hook is a function in your cartridge that the platform calls before or after an API operation, so you can validate, change, or extend what happens. Hooks keep running because SCAPI and OCAPI share the same hooks. The storefront calls SCAPI, SCAPI fires the hook, and your cartridge code answers. That holds only for the Shopper APIs that support hooks: the docs list Shopper Experience, Shopper Payments, Shopper Custom Objects and Shopper Consents as having none, and a cached SCAPI response skips the hook until it expires. The docs note that hook names keep the historical dw.ocapi.shop.* prefix even when the caller is SCAPI, so an existing OCAPI hook needs no renaming. The mechanics haven’t changed, so I won’t repeat them here; Using OCAPI and SCAPI Hooks in SFCC has the hooks.json details.
Three rules from the docs matter in practice:
- SCAPI needs a switch. Hook execution for the Commerce APIs is enabled in Business Manager under Administration > Global Preferences > Feature Switches. If hooks silently don’t fire, check this before anything else.
- Names must match. The exported function name must match the hook name without its package prefix.
sfcc.app.tax.calculateexportscalculate. - Errors have consequences. In a Shopper API hook, returning
Status.ERRORrolls back and returns HTTP 400, and an uncaught exception returns HTTP 500. Commerce App extension points set their own rules, andsfcc.app.tax.calculateblocks on both.
The Calculate Hook
“Calculating” a basket means recomputing its totals: product prices, promotions, shipping, and tax. dw.order.calculate is the extension point for that work, and it has a default implementation that you can override. The storefront never calls it directly. The platform runs it as a side effect of many basket and order operations, which is why it feels automatic. Server-side code can also call it explicitly, and the documented sample does so inside an afterPUT hook like this:
var HookMgr = require('dw/system/HookMgr');
HookMgr.callHook('dw.order.calculate', 'calculate', basket);
The calling code passes the hook name, the function name, and the basket. Nothing else is needed.
Per the docs, if a Shopper API hook returns a value, it skips the system implementation of that hook and any hooks registered after it, and the docs recommend returning nothing so that important functions like the cart calculate hook still run. If your calculate hook is shared with controllers and opens its own transaction, that breaks SCAPI, so branch with request.isSCAPI() where the behaviour has to differ. And if your calculation comes from SFRA’s app_storefront_base, SiteGenesis, or a custom dw.order.calculate hook, it can bypass the Commerce App extension points. The documented fix is to call TaxMgr.applyTax and ShippingMgr.applyShipping from your calculate.js instead of calling the dw.order.calculateTax and dw.order.calculateShipping hooks directly. It only matters if you install a tax or shipping Commerce App, and the install-time warning doesn’t block installation.
Warning
Which script version does the calculate hook run? Two hook names are in play. The Script API reference for
CalculateHookssays the defaultdw.order.calculateimplementation falls back to the olderdw.ocapi.shop.basket.calculatehook, which is deprecated and writes to the deprecated API usage logs, and it tells you to overridedw.order.calculateinstead. So if your cartridge registersdw.order.calculate, that is the version that runs; if it only registers the old name, the default implementation calls that. Registered hooks run in cartridge-path order, so a second cartridge registering the same hook changes the outcome, and Commerce App tax providers sit outside that ordering. I found nothing that says Storefront Next picks a different script, but log from the hook on your own instance before you rely on it.
Cartridges and Jobs Must Stay on the Path
Hooks and custom job steps are registered through cartridges (hooks.json and steptypes.json), and the code behind your services lives there too, so a cartridge only counts when it is on the site’s cartridge path (or the Business Manager site’s path, for organisation-level resources). Services (the wrappers SFCC uses for calls to external systems) are configured in Business Manager, but the code that calls them is not. The path is searched left to right, and for files the first match wins; the cartridge path post shows what that means for overrides. Hooks are the exception: every module registered for an extension point runs, in cartridge-path order. All of this is general platform behaviour from the Cartridges guide, and the Storefront Next Page Designer guide still has you add app_storefrontnext_base to the path.
Don’t remove a cartridge because “the frontend is React now”. A job is configured in Business Manager, but any custom step it uses comes from a steptypes.json in a cartridge, so a nightly export built on custom steps stops working once that cartridge leaves the path or its code version is no longer active. The same goes for hooks, and for the code behind your services; the service configurations themselves stay in Business Manager.
If you plan to install a tax or shipping Commerce App, SFRA’s app_storefront_base and the SiteGenesis cartridges can bypass the Commerce App extension points, because their calculate.js calls the legacy hooks directly. The install shows a warning, which doesn’t block installation, and the documented fix is the calculate.js change above. The docs say outright that you don’t need to remove those cartridges from the path. I’d still test the change on a sandbox before touching production paths.
How Site Preferences Reach the Storefront
Here is the most useful new bridge. The storefront doesn’t run on the instance, so it can’t call Site.getCurrent().getCustomPreferenceValue(). Instead, preferences are synced into the Managed Runtime (MRT) data store, and the app reads them from there. The data store guide describes the setup:
- Register
dataStoreMiddlewareLazyinsrc/root.tsx, aftersiteContextMiddleware. Middleware is code that runs on every request before the page loader, and this one prepares the preference lookup. It must come aftersiteContextMiddlewarebecause the site ID has to resolve first. The retail template already does this. - Site preferences land under the key
<siteId>-custom-site-preferences, and global ones undercustom-global-preferences. - In a loader (the React Router function that fetches data on the server for a route), call
getSitePreferencesLazy(context)orgetCustomGlobalPreferencesLazy(context). Both return a promise of a key-value record, ornullwhen the entry is missing, so add a fallback like?? {}. - Pass the values to components through
useLoaderData. There’s no client-side hook.
Sensitive values such as passwords are masked in the store and come back masked. A single preference can’t exceed 380 KiB, and larger values don’t sync. If the store is unreachable, SFNEXT_DATA_STORE_UNAVAILABLE_MODE defaults to fallback and returns an empty object, so set it to throw if you’d rather fail loudly. For local development, seed values with MRT_DATA_STORE_DEFAULTS.
The Five-Minute Wait, and Its Replacement
Until October 2026, site preferences synced to Managed Runtime periodically, so a change could take several minutes to show up. The data store page says the sync is based on the B2C Target Info and Site IDs configured for your Managed Runtime environment, but it doesn’t name a job, and neither does anything else I found. Don’t confuse it with sfcc-push-page-manifests, which is the Page Designer manifest job and runs every five minutes on production after replication.
That delay is gone. The MRT release notes say that since B2C Commerce 26.10 (enabled for all customers on 30 October 2026) preference changes reach the storefront shortly after you save them, with no action on your side. So if a preference still looks stale, I’d check the key name, the site ID, the middleware order, the 380 KiB limit, and the B2C Target Info and Site IDs on the environment before blaming the sync timing.
What Lives Where
| Concern | Where it lives | How the storefront reaches it |
|---|---|---|
| Rendering, routing, components | Storefront Next on MRT | Runs in the React app |
| Page Designer metadata | app_storefrontnext_base cartridge, plus page manifests built by the platform | Cartridge deployed to the instance; system jobs push the manifests to the MRT data store |
| Basket and order calculation | Default dw.order.calculate hook, that your cartridge can override | Triggered implicitly by SCAPI basket and order calls |
| Custom OCAPI/SCAPI hooks | Your cartridges | SCAPI, with hook execution enabled |
| Custom SCAPI endpoints | Custom API in your cartridge, on the site’s cartridge path | The storefront calls it like any other SCAPI endpoint |
| Scheduled jobs, services | Cartridges on the instance | Not called by the storefront; run by the platform, or called from hooks and custom APIs |
| Custom site preferences | Business Manager | MRT data store, read in loaders |
| Tax providers | Commerce App extension points | The platform calls the registered provider through the Extension Registry |
If a row feels ambiguous, ask one question: does it render something, or does it decide something every channel has to agree on? Rendering moved to React. Those decisions stayed behind the API, and the cartridge that holds that logic stays on the path.
