Window Nimstrata Properties
window.Nimstrata is the storefront configuration object read by Nimstrata App Block JavaScript.
For normal Online Store 2.0 installs, Shopify Liquid App Blocks create the required values from app settings, Shopify localization data, and app metafields. For Online Store 1.0 installs, first enable Enable translations on 1.0 themes in the Core Components App Embed. Add custom window.Nimstrata properties only for a bespoke theme integration that cannot be configured in the Retail Cloud Connect Shopify App.
Define any manual values before loading the Nimstrata storefront bundle.
Property Reference
Local Inventory Place
Set the Shopify location ID before loading the storefront bundle when the page already knows the shopper's active place:
window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.placeId = '75095408826';
After the bundle loads, change the place with window.Nimstrata.setPlaceId('75095408826') or clear it with window.Nimstrata.setPlaceId(null). The setter persists or clears the first-party functional rcc-place-id cookie and makes mounted Search and Product Grid App Blocks refetch.
Each changed value emits a public event on window. Setting a place emits retail-connect:place:set with { placeId, previousPlaceId }; clearing it emits retail-connect:place:removed with { placeId }, where placeId is the removed value. Repeating the current value does not emit an event.
window.addEventListener('retail-connect:place:set', ({ detail }) => {
console.log('Place set', detail.placeId);
});
window.addEventListener('retail-connect:place:removed', ({ detail }) => {
console.log('Place removed', detail.placeId);
});
On page load, a non-empty window.Nimstrata.placeId takes precedence over the decoded rcc-place-id cookie. Search and collection requests send the active value as top-level placeIds: [placeId].
For locations selected in the Shopify app's Local Inventory settings, the
filter displays a smaller, regular-weight Local Store row above the saved
storefront display name. Change Store uses the same position, size, and
colour as the filter's normal Clear action. The local-inventory filter does
not show a separate Clear action. Clicking Change Store keeps the active
place and selected local fulfillment values until an integration calls
setPlaceId with a new place, and closes the surrounding native filter dialog.
The display name defaults to the Shopify Admin location name and can be edited
without changing the location itself. If the active place has no saved name,
the heading is the single normal-size Local Store fallback.
The action is visible by default. A bespoke integration can hide it without discarding saved place names:
window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.settings = window.Nimstrata.settings || {};
window.Nimstrata.settings.localInventory = {
...window.Nimstrata.settings.localInventory,
showChangeStoreButton: false,
};
Manual Search Example
<script>
window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.search = window.Nimstrata.search || {};
window.Nimstrata.search.defaultFilters = [
{
field: 'attributes.available_in_market',
value: ['GB'],
type: 'string',
},
];
window.Nimstrata.search.customFilters = [
{
name: 'in_stock',
displayName: 'In stock',
displayComponent: 'switch',
displayLocation: 'toolbar',
filter: {
field: 'availability',
value: ['IN_STOCK'],
type: 'string',
},
},
];
</script>
When a mapped Shopify filter URL contains a Metaobject GID value, the Search or
Product Grid App Block resolves it to storefront display text before applying
keyMappings. For example,
gid://shopify/Metaobject/182167241028 can become Tinted. The lookup is made
only when such a GID is present and requires the App Block's Storefront token to
have metaobject access; otherwise the original value is retained.
Manual Conditional Filter Visibility Example
Use filterVisibilityRules only for bespoke storefront behavior that cannot be configured as a normal App Block filter or layout setting. Rules must be defined before the Search Results or Product Grid App Block starts.
window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.search = window.Nimstrata.search || {};
window.Nimstrata.search.filterVisibilityRules = [
{
field: 'attributes.series',
visibleWhen: ({ getFacetValues, getFilterValues }) => {
const selectedBrands = getFilterValues('brands');
if (selectedBrands.length > 0) {
return selectedBrands.length === 1;
}
return getFacetValues('brands').length === 1;
},
},
];
This example renders the attributes.series filter only when exactly one brand is selected or exactly one brand is available in the current result set. If the shopper later selects multiple brands, the App Block hides attributes.series and removes any selected series values.
For promotions, ads, or editorial content between product cards, see Content Inside Search and Collection Grids. That guide covers Liquid templates, Web Components, spans, placement, pagination, and runtime updates.
Manual Translation Example
Use this only for manual installs that cannot use the Retail Cloud Connect Shopify App Translations page.
window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.translations = window.Nimstrata.translations || {};
window.Nimstrata.translations.default = {
'search.placeholder': 'Search',
'toolbar.refine_filters': 'Refine Filters',
brands: 'Brand',
};
window.Nimstrata.translations.filters = {
sizes: {
sizes: 'Size',
Small: 'Small',
Medium: 'Medium',
Large: 'Large',
},
};
Manual Recommendation Example
window.Nimstrata = window.Nimstrata || {};
window.Nimstrata.recs = window.Nimstrata.recs || {};
window.Nimstrata.recs.defaultFilters = [
{
field: 'attributes.available_in_market',
value: ['GB'],
type: 'string',
},
];
When no availability filter is provided, recommendations add { field: 'availability', value: ['IN_STOCK'], type: 'string' } automatically.
Safer Alternatives
Before adding custom JavaScript, check whether the app already covers the need:
- Use Translations for App Block copy and filter labels.
- Use App Block Filters for normal storefront facets.
- Use Layout Settings for filter layout, quick filters, counts, search-within-filters, sort placement, and product-card link behavior.
- Use Custom and Default Filters for hidden filters or visible custom switches.