WrShop
webround-docs / WrShop
Interface: WrShop
Defined in: wr.d.ts:371
The shop context — provides access to the product catalog, collections, filters, sorting, search, and navigation state.
Available as wr.shop in every custom component.
Example
const { products, isLoading, collections } = wr.shop;
Properties
activeCollectionFilterIds
activeCollectionFilterIds:
string[]
Defined in: wr.d.ts:413
Filter IDs active for the current collection
appliedRangeFilters
appliedRangeFilters:
Record<string, {value: [any,any]; }>
Defined in: wr.d.ts:409
Range filter values currently applied to the query
appliedSearchTerm
appliedSearchTerm:
string
Defined in: wr.d.ts:385
Last applied search term
appliedTagValueIds
appliedTagValueIds:
string[]
Defined in: wr.d.ts:405
Tag value IDs currently applied to the query
attributes
attributes:
WrAttribute[]
Defined in: wr.d.ts:401
All available sortable/filterable attributes
breadcrumb
breadcrumb:
WrCollection[]
Defined in: wr.d.ts:391
Breadcrumb trail of navigated collections
collections
collections:
WrCollection[]
Defined in: wr.d.ts:395
All available root collections
currencyCode
currencyCode:
string
Defined in: wr.d.ts:381
Active currency code (ISO 4217)
enableCartButton
enableCartButton:
boolean
Defined in: wr.d.ts:419
Whether the add-to-cart button is enabled
enableReviews
enableReviews:
boolean
Defined in: wr.d.ts:421
Whether the reviews feature is enabled
enableWishlist
enableWishlist:
boolean
Defined in: wr.d.ts:417
Whether the wishlist feature is enabled for this store
filters
filters:
WrFilter[]
Defined in: wr.d.ts:399
All available range filters
isErrorProducts
isErrorProducts:
boolean
Defined in: wr.d.ts:423
Whether the last product fetch returned an error
isLoading
isLoading:
boolean
Defined in: wr.d.ts:375
Whether products are currently loading
isLoadingMetadata
isLoadingMetadata:
boolean
Defined in: wr.d.ts:411
Whether store metadata (collections, tags, filters) is loading
pagination
pagination:
WrPagination
Defined in: wr.d.ts:377
Current pagination state
products
products:
WrProduct[]
Defined in: wr.d.ts:373
Current page of products
searchTerm
searchTerm:
string
Defined in: wr.d.ts:383
Current search input (not yet applied)
selectedLeaf
selectedLeaf:
WrCollection
Defined in: wr.d.ts:393
Currently selected leaf collection
selectedProduct
selectedProduct:
WrProduct
Defined in: wr.d.ts:387
Currently selected product for detail view
selectedRangeFilters
selectedRangeFilters:
Record<string, {value: [any,any]; }>
Defined in: wr.d.ts:407
Range filter values currently selected (staging)
selectedTagValueIds
selectedTagValueIds:
string[]
Defined in: wr.d.ts:403
Tag value IDs currently selected (staging, not yet applied)
selectedVariant
selectedVariant:
WrVariant
Defined in: wr.d.ts:389
Currently selected variant
sortOption
sortOption:
WrSortOption
Defined in: wr.d.ts:379
Active sort configuration
store
store:
Record<string,any>
Defined in: wr.d.ts:415
Raw store metadata (cadences, currencies, etc.)
tags
tags:
WrTag[]
Defined in: wr.d.ts:397
All available tags
Methods
applyFilters()
applyFilters():
Promise<void>
Defined in: wr.d.ts:478
Apply all staged tag and range filters and reload products.
Returns
Promise<void>
Example
wr.shop.applyFilters()
applySearch()
applySearch():
Promise<void>
Defined in: wr.d.ts:436
Apply the current search term and reload products.
Returns
Promise<void>
Example
wr.shop.applySearch()
goBackCollection()
goBackCollection():
Promise<void>
Defined in: wr.d.ts:513
Navigate back to the parent collection.
Returns
Promise<void>
Example
wr.shop.goBackCollection()
navigateToCollection()
navigateToCollection(
collectionId):Promise<void>
Defined in: wr.d.ts:507
Navigate into a collection, updating breadcrumb, leaf, and active filters.
Pass null to reset to the root.
Parameters
collectionId
string
Returns
Promise<void>
Example
wr.shop.navigateToCollection('collection-uuid')
resetFilters()
resetFilters():
Promise<void>
Defined in: wr.d.ts:484
Reset all filters and reload products.
Returns
Promise<void>
Example
wr.shop.resetFilters()
resetRangeFilter()
resetRangeFilter(
filterId):void
Defined in: wr.d.ts:500
Reset a single range filter.
Parameters
filterId
string
Returns
void
Example
wr.shop.resetRangeFilter('filter-uuid')
resetSearch()
resetSearch():
Promise<void>
Defined in: wr.d.ts:442
Clear the search term and reload products.
Returns
Promise<void>
Example
wr.shop.resetSearch()
selectProduct()
selectProduct(
product):Promise<void>
Defined in: wr.d.ts:519
Set the currently selected product for detail view.
Parameters
product
Partial<WrProduct>
Returns
Promise<void>
Example
wr.shop.selectProduct(product)
selectVariant()
selectVariant(
variant):Promise<void>
Defined in: wr.d.ts:525
Set the currently selected variant.
Parameters
variant
Partial<WrVariant>
Returns
Promise<void>
Example
wr.shop.selectVariant(variant)
setCurrency()
setCurrency(
code):Promise<void>
Defined in: wr.d.ts:454
Change the active currency for price display.
Parameters
code
string
Returns
Promise<void>
Example
wr.shop.setCurrency('USD')
setLimit()
setLimit(
limit):Promise<void>
Defined in: wr.d.ts:466
Change the number of products per page.
Parameters
limit
number
Returns
Promise<void>
Example
wr.shop.setLimit(24)
setPage()
setPage(
page):Promise<void>
Defined in: wr.d.ts:460
Navigate to a specific page.
Parameters
page
number
Returns
Promise<void>
Example
wr.shop.setPage(2)
setRangeFilter()
setRangeFilter(
filterId,value,isPrice?,cadence?):void
Defined in: wr.d.ts:494
Set a range filter value (staging only — call applyFilters() to execute).
Parameters
filterId
string
The filter ID
value
[any, any]
A [min, max] tuple
isPrice?
boolean
Whether to apply cadence-based price filtering
cadence?
string
Billing cadence for price filtering
Returns
void
Example
wr.shop.setRangeFilter('filter-uuid', [10, 100], true, 'once')
setSearch()
setSearch(
term):Promise<void>
Defined in: wr.d.ts:430
Update the search input without triggering a fetch.
Call applySearch() to execute.
Parameters
term
string
Returns
Promise<void>
Example
wr.shop.setSearch('running shoes')
setSort()
setSort(
option):Promise<void>
Defined in: wr.d.ts:448
Change the active sort option.
Parameters
option
Partial<WrSortOption>
Returns
Promise<void>
Example
wr.shop.setSort({ sortBy: 'price', sortDirection: 'asc' })
toggleTag()
toggleTag(
tagValueId):Promise<void>
Defined in: wr.d.ts:472
Toggle a tag value selection (staging only — call applyFilters() to execute).
Parameters
tagValueId
string
Returns
Promise<void>
Example
wr.shop.toggleTag('tag-value-uuid')