Analytics & Reports
Analytics

Record-count

Displays the current search product record count given a search response.

Provided Aliases: $recordCount

Structure

<gb-record-count>
  <h2 if="{ !$recordCount.hasResults }">{ props.labels.noResults }</h2>
  <h2 if="{ $recordCount.hasResults }">Showing { $recordCount.from } to { $recordCount.to } of { $recordCount.total } for { $recordCount.query }</h2>
</gb-record-count>

Example Implementation

const labels = {
  noResults: 'Nothing to show!'
};

<gb-record-count labels="{ labels }"></gb-record-count>

Properties

Property Type Default Notes
labels { noResults: string } { noResults: 'No results found' } Object with noResults label for search response with no records.

State

Property Type Default Notes
query string The current query that is causing product results.
from number 1 The first product visible on the page.
to number The last product visible on the page.
hasResults boolean true when response has products, false otherwise.
total number The total number of products returned in the response.

Events

Event Affected State Properties
'page_updated' from, hasResults, to
'record_count_updated' total