omniboom - showing the lowest price on the storefront ===================================================== RECOMMENDED: the "Lowest price" app block ----------------------------------------- Online Store > Themes > Customize > product template > Add block > Apps > "Lowest price" (omniboom). No code to edit. Its look, labels and options (icon, tooltip, percentage, date) are set in the omniboom admin, under Widget, and the block renders exactly the preview shown there. The block reads only app-owned data: - variant.metafields["$app"].min_price.value (v2, see below) - app.metafields.omniboom.widget_style.value (the widget style) The "$app" prefix resolves only inside the app's own extension. It cannot be used from theme code: there the namespace is app----..., which is why legacy themes use the compatibility metafield below instead. $app:min_price (v2): { "": { "p": " ", "d": "YYYY-MM-DD" | null, "n": } } Only markets on sale have a key; {} means no notice anywhere. COMPATIBILITY: a snippet copied into the theme (v1 metafield) ------------------------------------------------------------- For themes that already show the lowest price with a hand-written snippet. Turn on omniboom > Settings > Theme compatibility. omniboom then also writes the v1 value to custom.omni_price_lowest_30d (single_line_text_field): { "": " ", ... } No date and no reference period in this format. With the option off, the next nightly update writes {} there, so a copied snippet shows nothing. The value is a JSON STRING in Liquid: _raw["it"] returns nil, and parse_json is not available on every theme. Extract the price with split, falling back to the "primary" key: {% assign _v = product.selected_or_first_available_variant %} {% if _v.compare_at_price and _v.compare_at_price > _v.price %} {% assign _raw = _v.metafields.custom.omni_price_lowest_30d.value %} {% if _raw %} {% assign _h = localization.market.handle | default: 'primary' %} {% assign _min = nil %} {% assign _token = '"' | append: _h | append: '":"' %} {% if _raw contains _token %} {% assign _min = _raw | split: _token | last | split: '"' | first %} {% endif %} {% unless _min %} {% if _raw contains '"primary":"' %} {% assign _min = _raw | split: '"primary":"' | last | split: '"' | first %} {% endif %} {% endunless %} {% if _min %}

Lowest price in the last 30 days: {{ _min | escape }}

{% endif %} {% endif %} {% endif %} Notes: - "30 days" is hard-coded in this snippet. If a market uses another reference period (omniboom > Markets), write that number instead, or switch to the app block, which takes it from the minimum itself. - The metafield is in the shared "custom" namespace: other apps and staff can edit it. Always output it with | escape, as above. - The price is shown as stored ("44.90 EUR"), not in the shop's money format.