A storefront site runs its own cartridge path, and two sites on one instance can resolve the same require to different files. A site scope tells the IDE which site you are working on. With a site selected, completion, Go to Declaration, the Salesforce B2C Commerce project view and the pipeline tools follow that site's cartridge order, the same way the server does
Pick a site
Open B2C Site Scopes
Click the site scope widget in the status bar at the bottom of the IDE. It reads Global scope, or the selected site with the number of cartridges on its path, for example "RefArch (3)"
Look at the sites
The B2C Site Scopes popup lists the sites from your active instance and from your project, see the sections below. Hover a site to see its ID and cartridge path
Select one
Click a site. The widget switches to it, open files are re-analyzed and navigation now follows its cartridge path. Choose Global scope to go back to every linked cartridge
Where the sites come from
| Section | Lists | Needs |
|---|---|---|
| Remote instance: Dev 01 | The sites of the active connection, with the cartridge path each one has on the instance | An active connection. The plugin asks the instance with the connection's account, OCAPI is not needed |
| Local project | Sites from site.xml files in the project, such as site import data, with their custom-cartridges path | A site.xml whose site has an ID and a name. Edits to the file are picked up automatically |
| Global | Global scope | Nothing. Every linked cartridge is used, in name order |
While the lists load you see "Loading B2C site scopes" or "Loading local project site scopes". How it works at the bottom opens an article about the feature
Site menu
Hover a site and open its submenu
| Item | What it does |
|---|---|
| Show cartridge path | Shows the site's cartridges in order, titled for example "RefArch cartridge path (3)" |
| Copy cartridge path | Copies the path, for example app_custom:int_paypal:app_storefront_base, and confirms with Cartridge path copied |
| Open Business Manager | Remote sites only. Opens Business Manager of the active connection |
| Open site.xml | Local sites only. Opens the site.xml the site was read from |
Show cartridge path and Copy cartridge path are disabled for a site that has no cartridge path
To change the cartridge path of a local site, open its site.xml and click the gutter icon on <custom-cartridges>. The Cartridge Path Editor edits the path as a list, and the Local project section picks up the new order
What the scope changes
| Area | With a site selected |
|---|---|
| JavaScript and DemandwareScript | require('*/...') and module.superModule resolve along the site's cartridge path, see Module Resolution |
| Routes and controllers | Go to Declaration and route lookups prefer the controller the site would run |
| Page Designer | Component scripts resolve along the site's path |
| Overrides | The cartridge list in the override dialog follows the site's order |
| Salesforce B2C Commerce project view | The root shows the site name, and cartridges follow its path. See Cartridges & Modules |
| Pipeline Editor | Opening a storefront route uses the selected site |
| Pipeline debugging | The debug session runs against the selected site |
Uploads and deploys don't depend on the scope: every linked cartridge is still uploaded. The scope only changes the order and which site the IDE follows
Troubleshooting
| Symptom | What to do |
|---|---|
| Cannot load remote site scopes | The plugin couldn't read the sites from the active connection. Check the connection with Test Connection in Connections, then open the popup again |
| "No remote site scopes were returned" | The instance returned no sites for this account. Use a local site.xml or Global scope |
| The Local project section is missing | The project has no site.xml with a site, or indexing is still running. "Wait for project indexing to finish" means the IDE is still indexing |
| A cartridge on the path is not used | The site's path names a cartridge that is not linked in the project. Link it in Cartridges & Modules |
| "Select a site scope before opening a storefront route." | The pipeline editor opens storefront routes on the selected site. Pick one in the widget |
| The widget is missing from the status bar | Right-click the status bar and turn on B2C Site Scopes |