Overrides

See every cartridge that has the open file, compare two copies, and create an override in another cartridge

The Overrides view in VS Code's built-in Explorer follows the file open in the editor. It lists every linked cartridge that has a file at the same path inside the cartridge, in the order of the active B2C Scope. The top row is the copy the server runs, so you can tell at a glance whether your edit takes effect or is shadowed by a cartridge further up the path

Open a file and the Overrides view lists every cartridge that has the same file in cartridge path order, with the active one marked ← Current. The row action compares it with that override, and Override in another cartridge creates the file in the cartridge you pick, extended or copied

The Overrides view

  • The header reads Overrides (N), where N is the number of cartridges that have the file
  • The cartridge of the file in the editor is marked ← Current and selected
  • Click a row to open that cartridge's copy of the file
  • Search in Overrides in the view title filters the rows by cartridge name
  • With no file open, the view asks you to open one in the editor

The view updates when you switch editors, so it always describes the file you are looking at. It only covers linked cartridges; link missing ones in Cartridge Management

Compare two copies

Hover a row and click Compare with Active File in Editor. VS Code opens a diff titled app_custom ↔ app_storefront_base (CheckoutServices.js), with the file in the editor on the left and that cartridge's copy on the right. Use it to see what an override changes before you edit either side

To compare the local file with the copy uploaded to the sandbox instead, use Compare with B2C Instance in the editor title bar. See Upload and Deploy

Override in another cartridge

Override in another cartridge creates the same file in a cartridge you choose, already wired to the copy below it. Start it from the Overrides view title, or from the editor title bar of a file in a linked cartridge

Pick the cartridge

Override CheckoutServices.js in another cartridge lists your linked cartridges in B2C Scope order, each with the file's path inside the cartridge. The current cartridge is preselected and marked └ Current, and cartridges that already have the file are marked └ 📍 Overridden here

Choose how to start the file

Select override options for CheckoutServices.js in int_loyalty offers a starting point. Controllers get Extend controller, other scripts get Extend script, and both get Copy file content

Edit the new file

The plugin creates the missing folders, writes the file and opens it. If the cartridge already has the file, it asks first: File already exists in the selected cartridge. Do you want to override it? with Yes, override

OptionThe new file
Extend controllerserver.extend(module.superModule), so you append, prepend or replace routes of the base controller
Extend scriptvar base = module.superModule, so you reuse the base module and change only what you need
Copy file contentA full copy of the current file, for templates, properties, and files you rewrite
int_loyalty/cartridge/controllers/CheckoutServices.js (Extend controller)
"use strict";

var server = require('server');
server.extend(module.superModule);

module.exports = server;
int_loyalty/cartridge/scripts/helpers/productHelpers.js (Extend script)
"use strict";

var base = module.superModule;

module.exports = base;

The new file only runs where its cartridge is on the site's cartridge path, ahead of the cartridge it overrides. Check the order in the Cartridge Path Editor

For AI agents

Agents get the same answer before they edit. The SFCC MCP server has intellijsfcc.file.top_override to pick the copy that actually runs, intellijsfcc.file.find_overrides to list higher-precedence copies, and a confirmed intellijsfcc.file.override_create plan and execute pair that creates an override the same way the view does. In GitHub Copilot agent mode the Get File Top Override tool does the same lookup. See SFCC MCP and GitHub Copilot

On this page