Advanced Features & Customization
Using the Liquid Drop
SearchJet provides a Liquid drop object (searchjet) for advanced theme developers to have full control over the integration.
Example: Accessing Search Data in a Template (e.g.,Ā search.liquid)
liquid
{% if searchjet.performed %}
Search Results for "{{ searchjet.terms | escape }}"
Found {{ searchjet.results_count }} results.
{% for product in searchjet.results %}
{% endfor %}
{% if searchjet.pagination.pages > 1 %}
{{ searchjet.pagination | default_pagination }}
{% endif %}
{% endif %}
Key Liquid Objects:
searchjet.performed: ReturnsĀtrueĀ if a search was performed.searchjet.terms: The userās search query.searchjet.results: The array of product results.searchjet.results_count: The total number of results.searchjet.pagination: Handles pagination links.
Theme Integration (Manual)
If the automatic injection doesnāt work perfectly with your theme, you can manually replace your themeās search form.
- Locate your themeās search form.Ā This is typically in a file likeĀ
sections/header.liquidĀ orĀlayout/theme.liquid. - Replace the existing form.Ā Find theĀ
Ā tag withĀaction="/search"Ā and replace it with the form structure provided in the SearchJet documentation or admin panel, which typically points to the SearchJet-handled search route.
Example Manual Search Form:
html
(Note: The exactĀ actionĀ URL may vary; refer to the appās instructions).