# Store Filters These filters are used for working with store-related data in Liquid templates. They help generate asset URLs, create links, format prices, and handle translations. Use these filters to manage store assets, display product information, and support localization in your storefront. ## asset_url Get URL for theme asset file. If you have a JSON cache manifest file in the public directory of your theme, the cached index is automatically retrieved. >>> public/cache.manifest.json ```json { "js/cache-broken.js" => "js/cache-broken.234adsdsf2341234.js" } ``` **Input** ```liquid {{ 'image/my-asset.png' | asset_url }} {{ 'main.css' | asset_url }} {{ 'js/cache-broken.js' | asset_url }} ``` **Output** ```text https://www.mystore.com/image/my-asset.png https://www.mystore.com/main.234adsdsf2341234.css https://www.mystore.com/js/cache-broken.234adsdsf2341234.js ``` --- ## asset_url Get URL for theme asset file. If you have a JSON cache manifest file in the public directory of your theme, the cached index is automatically retrieved. >>> public/cache.manifest.json ```json { "js/cache-broken.js" => "js/cache-broken.234adsdsf2341234.js" } ``` **Input** ```liquid {{ 'image/my-asset.png' | asset_url }} {{ 'main.css' | asset_url }} {{ 'js/cache-broken.js' | asset_url }} ``` **Output** ```text https://www.mystore.com/checkout/image/my-asset.png https://www.mystore.com/checkout/main.234adsdsf2341234.css https://www.mystore.com/checkout/js/cache-broken.234adsdsf2341234.js ``` --- ## full_url Completes relative urls to absolute URLs. **Input** ```liquid {{ "/my/store/path" | full_url }} ``` **Output** ```text https://www.mystore.com//my/store/path ``` --- ## inline_asset_content Returns the content of a file from the theme's assets directory. Useful for inlining SVG icons. **Input** ```liquid {{ 'icon-account.svg' | inline_asset_content }} ``` **Output** ```text ... ``` --- ## is_ico Test if value is a .ico file. **Input** ```liquid {% if 'favicon.ico' | is_ico %} {% endif %} ``` --- ## link Creates a link to store resource. **Input** ```liquid {{ product | link }} ``` **Output** ```text https://www.mystore.com/product/my-product ``` --- ## link Creates a link to store resource. Works only if store context exists. **Input** ```liquid {{ product | link }} ``` **Output** ```text https://www.mystore.com/product/my-product ``` --- ## link_to_within Creates a category-aware URL for the product and wraps the links in anchor element **Input** ```liquid {{ product | link_to_within: category }} ``` **Output** ```text My Product Title ``` --- ## money Rounds the given amount in currenct display currency. **Input** ```liquid {{ 3.45234 | money }} ``` **Output** ```text 3.45 ``` --- ## money_in_smallest Returns the given amount in the smallest currency unit. **Input** ```liquid {{ 3.45234 | money_in_smallest }} ``` **Output** ```text 345 ``` --- ## money_with_currency Returns the amount in current display currency rounded and formatted. **Input** ```liquid {{ 3.45234 | money_with_currency }} ``` **Output** ```text 3.45 € ``` --- ## query_params Return a array containing query params from given url. **Input** ```liquid {{ 'https://www.mystore.com/products/my-product?width=32&height=45' | query_params }} ``` --- ## svg_tag Renders a SVG from public directory of your theme. **Input** ```liquid {{ 'icon' | svg_tag}} ``` **Output** ```text ``` For more advanced usage, you can define SVG attributes as filter parameters and set a CSS class for the `svg` element. **Input** ```liquid {{ 'icon' | svg_tag: stroke:'blue', width: 20, height: 20, class: 'my-svg-class' }} ``` **Output** ```text ``` --- ## t Retrieve a translation with given key from the locale file for the active locale. **Input** ```liquid {{ "add_to_cart" | t }} {{ "sold_out" | t: title: product.title }} ``` **Output** ```text Add to cart Product Jeans is sold out ``` --- ## weight_with_unit Returns the weight for a product with unit. **Input** ```liquid {{ product | weight_with_unit }} ``` **Output** ```text 3,4 kg ``` --- ## within Creates a category-aware URL for the product. **Input** ```liquid {{ product_url = product | within: category }} ``` **Output** ```text https://www.mystore.com/products/my-product?category=my-category ```