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. Add custom window.Nimstrata properties only for a manual Online Store 1.0 install or 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
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>
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.
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.