> ## Documentation Index
> Fetch the complete documentation index at: https://amasty.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding the lowest price block to non-product pages

> Add the Omnibus Insight lowest price block to the homepage, collection pages and the related products block.

By default, the lowest price block is displayed on product pages. You can also add it to the homepage, collection pages and the related products block by adding the code snippets below to your theme.

## Add the lowest price block to the homepage and collections

**1. Open the theme code editor**

Head to the theme settings, and then click on **Edit code**.

![Edit theme page](https://guide.amasty.com/media/.renditions/wysiwyg/omni6.png)

**2. Open Snippets**

In the theme editor sidebar, find and click on the **Snippets** section to expand the list of existing snippet files.

**3. Create a new file**

At the top of the expanded list, you will see a button labeled **New File**. Click this button to create a new snippet file.

![New File button](https://guide.amasty.com/media/.renditions/wysiwyg/Shopify_Omnibus/edit-code-side-bar-161.png)

**4. Name the snippet**

A text field will appear where you can enter a name for your new snippet.

![Snippet name field](https://guide.amasty.com/media/.renditions/wysiwyg/Shopify_Omnibus/2025-09-25-11-41-50.png)

Name it `am-lowest-price.liquid` and press **Enter**.

![New snippet created](https://guide.amasty.com/media/.renditions/wysiwyg/Shopify_Omnibus/2025-09-25-11-42-34.png)

**5. Add the code**

On the right side of the screen, in the tab corresponding to the new snippet, **add the content below** to the code text field and **save**.

```liquid expandable theme={null}
 <script type="application/json">
    {
        "shop": {{ shop.metafields["app--80349265921"].am_lowest_price_settings.value | json | replace: '<', '\u003c' }},
        "product": {{ product.metafields["app--80349265921"].am_lowest_price.value | json | replace: '<', '\u003c' }},
        "variant": {{ product.selected_or_first_available_variant.metafields["app--80349265921"].am_lowest_price.value | json | replace: '<', '\u003c' }},
        "texts": {
            "label": {{ shop.metafields["omnibus_insight"]["am_lowest_price_label"].value | json | replace: '<', '\u003c' }},
            "popupIconText": {{ shop.metafields["omnibus_insight"]["am_lowest_price_icon_text"].value | json | replace: '<', '\u003c' }},
            "promotionPeriod": {{ shop.metafields["omnibus_insight"]["am_lowest_price_promotion_period"].value | json | replace: '<', '\u003c' }}
        }
    }
</script>
<am-omnibus-listing
    id="am-omnibus-container-{{ product.id }}"
    style="display: block; position: relative; z-index: 1"
    product-id="{{ product.id }}"
    variant-id="{{ product.selected_or_first_available_variant.id }}"
    price="{{ product.selected_or_first_available_variant.price }}"
    compare-at-price="{{ product.selected_or_first_available_variant.compare_at_price }}"
    market-id="{{ localization.market.id }}"
    company-id="{{ customer.current_company.id }}"
    shop-id="{{ shop.id }}"
></am-omnibus-listing>
<script>
(()=>{async function e(e){var t,r,n;let{shop:i,locale:l,currency:o,country:a}=window.Shopify;if(!i)return;let s={AR:"es",AZ:"az",BG:"bg",DE:"de",ES:"es",FI:"fi",FJ:"fj",FO:"fo",FR:"fr",HR:"hr",HT:"ht",HU:"hu",ID:"id",IS:"is",IT:"it",LT:"lt",LV:"lv",MG:"mg",MH:"mh",MK:"mk",MN:"mn",MT:"mt",NL:"nl",NO:"no",PL:"pl",PT:"pt",RO:"ro",RU:"ru",RW:"rw",SK:"sk",SO:"so",TH:"th",TO:"to",TR:"tr",US:"en",UZ:"uz"},c=(e,t)=>s[t]||(e||"").split(/[-_]/)[0]||e,u=(e,{marginTop:t=null,marginBottom:r=null}={})=>{let n=e||"";return null!==t&&(n=n.replace(/margin-top:\s*-?\d+px/,`margin-top: ${t}px`)),null!==r&&(n=n.replace(/margin-bottom:\s*-?\d+px/,`margin-bottom: ${r}px`)),n},p=(e,t,r)=>{let n=e.querySelector("#"+t);if(!n)return;let i=e.querySelector(".am-omnibus-promotion");i||((i=document.createElement("div")).className="am-omnibus-promotion",e.insertBefore(i,n)),i.innerHTML=r||"";let l=void 0!==n.dataset.amOmnibusMarginTop;r?(l||(n.dataset.amOmnibusMarginTop=n.style.marginTop),n.style.marginTop="0px"):l&&(n.style.marginTop=n.dataset.amOmnibusMarginTop,delete n.dataset.amOmnibusMarginTop)},_=["a","b","strong","i","em","u","br","span","p","small","sub","sup"],d=["http","https","mailto"],m=["href","target","rel"],$=["style","class"],f=e=>String(e??"").replace(/[&<>"']/g,e=>{switch(e){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case`"`:return"&quot;";default:return"&#039;"}}),h=e=>{let t=document.createElement("textarea");return t.innerHTML=e,t.value},b=e=>{let t=h(String(e).trim()).replace(/[\x00-\x1f\x7f]/g,"").trim();if(""===t||t.startsWith("/")||t.startsWith("#")||t.startsWith("//"))return!0;let r=t.indexOf(":");return -1===r||d.includes(t.slice(0,r).toLowerCase())},y=e=>{let t={},r=/([a-zA-Z][\w-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'`=<>]*)))?/g,n;for(;null!==(n=r.exec(e));)t[n[1].toLowerCase()]=n[2]||n[3]||n[4]||"";return t},g=(e,t)=>{let r="a"===e?m:$,n={};for(let i of Object.keys(t))r.includes(i)&&(n[i]=t[i]);return"a"!==e||(void 0===n.href||b(n.href)||delete n.href,void 0!==n.target&&"_blank"===n.target.toLowerCase()&&(n.rel="noopener noreferrer")),n},C=e=>Object.keys(e).map(t=>` ${t}="${f(e[t])}"`).join(""),w=e=>e.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)(\s[^>]*)?\s*\/?>/g,(e,t)=>_.includes(t.toLowerCase())?e:""),A=(e,t,r)=>{let n=t.toLowerCase();if(e.startsWith("</"))return`</${n}>`;let i=g(n,y(r||"")),l="br"===n||e.trimEnd().endsWith("/>");return l?`<${n}${C(i)} />`:`<${n}${C(i)}>`},T=e=>{let t=String(e??"").trim();if(""===t||!t.includes("<"))return t;let r=t,n=!1;for(let i=0;i<10;i++){let l=w(r).trim();if(l===r){n=!0;break}r=l}return n?r.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)(\s[^>]*)?\s*\/?>/g,(e,t,r)=>A(e,t,r)):f(r)},v=(e,t,r,n,i)=>{if(e)return e;let l=t;if(r&&r.length>0)for(let o of r)o.code&&(o.code===n||n.startsWith(o.code+"-"))&&o[i]&&(l=o[i]);return l},x=e=>T(e).replaceAll("\n","<br>"),O=e.getAttribute("product-id");if(!O||void 0===window.ShopifyAnalytics)return;let S=e.amRenderGeneration,E=()=>e.amRenderGeneration!==S||!e.isConnected,L=.01*e.getAttribute("price"),k=.01*e.getAttribute("compare-at-price"),j=Number(e.getAttribute("market-id")),R=Number(e.getAttribute("company-id")),H=`am-price-trends-${O}`,M=e=>"string"==typeof e?e.replaceAll(`\\"`,`"`):Array.isArray(e)?e.map(M):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,M(t)])):e,I=e=>{if(!e||"object"!=typeof e)return e;let t={...e};for(let r of["translations","languages"])r in t&&(t[r]=M(t[r]));return t},P=e=>e&&"object"==typeof e&&e.settings?{...e,settings:I(e.settings)}:e,Z=e=>"string"==typeof e&&""!==e?e:null,{shop:z,product:F,variant:N,texts:U}=(e=>{let t={shop:null,product:null,variant:null,texts:{label:null,popupIconText:null,promotionPeriod:null}};if(!e||!e.matches(`script[type="application/json"]`))return t;try{let r={...t,...JSON.parse(e.textContent)},n=r.texts&&"object"==typeof r.texts?r.texts:{};return{shop:I(r.shop),product:P(r.product),variant:P(r.variant),texts:{label:Z(n.label),popupIconText:Z(n.popupIconText),promotionPeriod:Z(n.promotionPeriod)}}}catch(i){return console.error(i),t}})(e.previousElementSibling),W=z?.custom_font_url?`AmCustomFont_${e.getAttribute("shop-id")}`:null;if(W&&!window.amOmnibusCustomFontLoaded){window.amOmnibusCustomFontLoaded=!0;let B=document.createElement("style");B.textContent=`@font-face {font-family: ${W};src: url("${z.custom_font_url}");font-display: optional;}`,document.head.appendChild(B),"undefined"!=typeof FontFace&&new FontFace(W,`url("${z.custom_font_url}")`).load().then(e=>document.fonts.add(e)).catch(()=>{})}let G=null,V=e.getAttribute("variant-id"),{page:q}=window.ShopifyAnalytics.meta,{pageType:D}=q;if(!["collection","home","searchresults"].includes(D))return;let K=async e=>{let t=o?.active;if(!t)return null;let r=`am_omnibus_rate_${t}_${e}`,n=(e=>{try{let t=localStorage.getItem(e);if(!t)return null;let{value:r,timestamp:n}=JSON.parse(t),i=Date.now();if(i-n<432e5)return r;return localStorage.removeItem(e),null}catch(l){return null}})(r);if(n)return n;let l=await fetch("/apps/am-omnibus-price",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({shop:i,operation:"currency_conversion",currency:o,lowestCurrency:e})});if(!l.ok)return null;let{rate:a}=await l.json();return((e,t)=>{try{if(!t){localStorage.removeItem(e);return}let r={value:t,timestamp:Date.now()};localStorage.setItem(e,JSON.stringify(r))}catch(n){}})(r,a),E()?null:a},X=async(t,r)=>{if("object"!=typeof t)return;let n=((e,t)=>{if(!t)return e.settings;if(e.hasCustomSettings){for(let r in t)r in e.settings||(e.settings[r]=t[r]);return e.settings}return t})(t,r);if(!n||"object"!=typeof n)return;let i=[e],{show_lowest:o,display_mode:s,popup_content:_,display_only_at_discount:d,percentage_mode:m,multi_currency_display_mode:$,period:f,languages:h,translations:b,css:y,icon_size:g,shop_currency:C,positive_percentage_color:w,negative_percentage_color:A,excluded_market_ids:T,excluded_company_ids:O}=n;if(!o)return;if(R){if(O&&O instanceof Array&&(O.includes(R)||O.includes(""+R)))return}else if(j&&T&&T instanceof Array&&(T.includes(j)||T.includes(""+j)))return;let S=C||t.shopCurrency,E=window.Shopify?.currency,M=E?.active,I=E?.rate,P,Z,z,F,N=null,W=t.markets,B=null;R&&W?.companies?.[R]?B=W?.companies?.[R]:j?B=W?.markets?.[j]:a&&(B=W?.countries?.[a]);let G=B?B.prices:null,V=B?B.lowest:null;if(G&&V){let q=G&&M?G[M]?.original:null;if(q)P=q.amount,F=q.currency;else{if(!V.original?.amount)return;S===V.original?.currency?(P=V.original.amount*I,F=M):(P=V.original.amount,F=V.original?.currency)}Z=L,z=!!(k&&k>L)}else P=t.lowest_price,t.currency===M?(F=M,Z=L,z=!!(k&&k>L)):(F=t.currency,Z=t.price,z=!!t.at_discount);if(F&&F!==S){if(!E||"object"!=typeof E)return;if(M&&F===M)I=1;else if(M&&S===M){if(P*=I=E.rate,1==+I&&F!==M)switch($){case"hide":return;case"original":N=F;break;default:if(!(I=await K(F)))return;P*=I,I=1}}else switch($){case"hide":return;case"original":N=F;break;default:if(!(I=await K(F)))return;P*=I,I=1}}if(null==P){"popup"===s&&"price_only"!==_&&Q(s).catch(),i.forEach(e=>p(e,H,""));return}if(d&&!z){i.forEach(e=>p(e,H,""));return}let D=y;if("popup"===s){let X=v(U.popupIconText,b.icon_text,h,l,"iconText");if(i.forEach(e=>{ee(e,_,y,g||20,X)}),"price_only"!==_){Q().catch();return}y=""}let J=Z<P,et=Z>P,er="inherit",en="";if(et)en="+",er=w||"rgb(214, 123, 123)";else if(J){en="-";let ei="rgb(110, 221, 168)";er=A&&A!==ei?A:"popup"===s?"rgb(16, 172, 132)":ei}let el=`color: ${er}`,eo,ea;0!==P?ea=` <span style="${el}">(${en}${eo=Math.abs(eo=parseFloat(eo=(Z/P-1)*100).toFixed(2))}%)</span>`:(eo=0,ea=""),("dont"===m||"positive"===m&&J||"zero_or_negative"===m&&et||0===eo)&&(ea=""),N?M=N:M&&M!==S&&I&&1!=+I&&(P*=I);let es=(e,t,r,n)=>{let i={style:"currency",currency:n,numberingSystem:"latn"},l=new Intl.NumberFormat(r?`${t}-${r}`:t,i).format(e);return l.includes(n)&&(l=new Intl.NumberFormat(t,i).format(e)),"USD"!==n&&/(?<![A-Za-z])\$/.test(l)&&(l+=` ${n}`),l},ec=es(P,c(l,a),a,M);ec||(ec=`${P} ${M}`);let eu=v(U.label,b.lowest,h,l,"text");eu||(eu=`The lowest price from last ${f} days: {lowest.price}`),eu.includes("{X}")&&(eu=eu.replaceAll("{X}",f)),eu=x(eu);let ep="",e_=t.promotion;if(e_&&!(e_.ends_at&&new Date(e_.ends_at)<=new Date)){let ed=v(U.promotionPeriod,b.promotion_period,h,l,"promotionPeriod");if(ed){let em=e=>{let[t,r,n]=String(e).split("-").map(Number),i=new Date(Date.UTC(t,r-1,n));return new Intl.DateTimeFormat(l||void 0,{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}).format(i)};ed=(ed=(ed=x(ed)).replaceAll("{start_date}",em(e_.start_date))).replaceAll("{end_date}",e_.end_date?em(e_.end_date):"");let e3=u(D,{marginBottom:2});ep=`<p class="caption" style="${e3}">${ed}</p>`}}let e$=ep?u(y,{marginTop:0}):y,ef;ef=eu.includes("{lowest.price}")?`<p class="caption" style="${e$}">${eu=eu.replaceAll("{lowest.price}",`${ec}${ea}`)}</p>`:`<p class="caption" style="${e$}">${eu}: ${ec}${ea}</p>`,"popup"===s&&"price_only"===_?(Y(H,ef,_).catch(),i.forEach(e=>p(e,H,ep))):i.forEach(e=>{e.innerHTML=ep+ef})},J=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;if("object"==typeof(t=z)&&t&&Object.keys(t).length>0&&Object.keys(z).some(e=>"custom_font_url"!==e)){if(V&&null!==N&&"object"==typeof(r=N)&&r&&Object.keys(r).length>0)return X(N,z);if(null!==F&&"object"==typeof(n=F)&&n&&Object.keys(n).length>0)return X(F,z)}async function Q(t){let r=[e],n=await fetch("/apps/am-omnibus-price",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({shop:i,productId:O,variantId:V,locale:l,currency:o,country:a,companyId:R,marketId:j,realPrice:L,realComparePrice:k,labelTemplate:U.label,popupIconTemplate:U.popupIconText,promotionTemplate:U.promotionPeriod})});if(!n.ok)return;let{lowestPriceHtml:s,displayMethod:c,popupContent:u,prices:_,plainCss:d,iconSize:m,iconText:$,chartColor:f,promotionHtml:h}=await n.json();!E()&&null!=s&&(t&&(c=t),r.forEach(e=>{if(c&&"always_visible"!==c){if(!s){p(e,H,"");return}ee(e,u,d,m||20,$),p(e,H,h);let t=null;"chart"===u&&(t="https://cdn.shopify.com/extensions/01a1e9c5-bb5b-7b2b-a9d4-f0dc308bad26/omnibus-insight-price-tracker-28/assets/chart.js"),Y(H,s,u,_,t,f).catch()}else e.innerHTML=(h||"")+s,void 0===c&&!s&&G&&G.destroy()}))}async function Y(t,r,n,i,o,s){let c=await et();!E()&&(G=new c(t,r,n,i,o,s,a,l,W),e.amTooltipRenderer=G,G.render())}function ee(e,t,r,n,i){if(e.querySelector(`#${H}`))return;let l=document.createElement("div"),o="#111111",a="12px",s="left";l.id=H,r&&(l.style.cssText=r,o=l.style.color,a=l.style.fontSize,s=l.style.textAlign),e.style.textAlign=s,l.style.display="inline-flex",l.style.alignItems="center";let c="default";"chart"===t&&(c="pointer"),l.style.cursor=c;let u=document.createElement("p");u.innerText=[void 0,null].includes(i)?"Price trends":i,u.style.margin="0 0 0 6px",u.style.borderBottom=`2px dotted ${o}`,u.style.fontSize=a,u.classList.add("caption");let p=function e(t="#111111",r=20){let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width",r),n.setAttribute("height",r),n.setAttribute("viewBox","0 1 16 14"),n.setAttribute("fill","none");let i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M6.5 3.5C6.5 3.08579 6.83579 2.75 7.25 2.75C7.66421 2.75 8 3.08579 8 3.5V3.75H8.75C9.16421 3.75 9.5 4.08579 9.5 4.5C9.5 4.91421 9.16421 5.25 8.75 5.25H6.5C6.22386 5.25 6 5.47386 6 5.75C6 6.02614 6.22386 6.25 6.5 6.25H7.5C8.60457 6.25 9.5 7.14543 9.5 8.25C9.5 9.35457 8.60457 10.25 7.5 10.25V10.5C7.5 10.9142 7.16421 11.25 6.75 11.25C6.33579 11.25 6 10.9142 6 10.5V10.25H5.25C4.83579 10.25 4.5 9.91421 4.5 9.5C4.5 9.08579 4.83579 8.75 5.25 8.75H7.5C7.77614 8.75 8 8.52614 8 8.25C8 7.97386 7.77614 7.75 7.5 7.75H6.5C5.39543 7.75 4.5 6.85457 4.5 5.75C4.5 4.64543 5.39543 3.75 6.5 3.75V3.5Z"),i.setAttribute("fill",t);let l=document.createElementNS("http://www.w3.org/2000/svg","path");return l.setAttribute("d","M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5C10.0376 1.5 12.5 3.96243 12.5 7Z"),l.setAttribute("fill-rule","evenodd"),l.setAttribute("clip-rule","evenodd"),l.setAttribute("fill",t),n.appendChild(i),n.appendChild(l),n}(o,n),_=function e(t="#111111",r=20){let n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width",r),n.setAttribute("height",r),n.setAttribute("viewBox","2 -4 14 18"),n.setAttribute("fill","none"),n.setAttribute("xmlns","http://www.w3.org/2000/svg");let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M5.44697 1.5C5.00114 1.5 4.61903 1.81867 4.53896 2.25725L3.53735 7.74387C3.2988 9.05057 2.16035 10 0.832058 10H0.75C0.335786 10 0 9.66421 0 9.25C0 8.83579 0.335786 8.5 0.75 8.5H0.832058C1.43583 8.5 1.95331 8.06844 2.06174 7.47448L3.06335 1.98787C3.27353 0.836541 4.27661 0 5.44697 0C6.71534 0 7.76907 0.978167 7.86328 2.24304L8.57919 11.8548C8.60629 12.2186 8.90939 12.5 9.27423 12.5C9.61494 12.5 9.90571 12.2537 9.96172 11.9176L10.4817 8.7979C10.7027 7.47189 11.8499 6.5 13.1943 6.5H15.25C15.6642 6.5 16 6.83579 16 7.25C16 7.66421 15.6642 8 15.25 8H13.1943C12.5832 8 12.0617 8.44177 11.9613 9.0445L11.4413 12.1642C11.2648 13.2236 10.3482 14 9.27423 14C8.12419 14 7.16876 13.1131 7.08334 11.9662L6.36743 2.35445C6.33154 1.87262 5.93013 1.5 5.44697 1.5Z"),i.setAttribute("fill",t),n.appendChild(i),n}(o,n);l.appendChild(p),l.appendChild(_),l.appendChild(u),e.appendChild(l)}async function et(){return(void 0===window.AmOmnibusTooltip&&(window.AmOmnibusTooltip={}),window.AmOmnibusTooltip.instance)?Promise.resolve(window.AmOmnibusTooltip.instance):(window.AmOmnibusTooltip.promise||(window.AmOmnibusTooltip.promise=new Promise((e,t)=>{let r="am-tooltip-lib:loaded",n=i=>{let l=i.detail,{AmOmnibusTooltip:o}=l;document.removeEventListener(r,n),o?(window.AmOmnibusTooltip.instance=o,e(o)):t(Error("Could not load AmTooltip lib"))};document.addEventListener(r,n),er("https://cdn.shopify.com/extensions/01a1e9c5-bb5b-7b2b-a9d4-f0dc308bad26/omnibus-insight-price-tracker-28/assets/tooltip.js").catch()})),window.AmOmnibusTooltip.promise)}async function er(e){try{let t=await fetch(e),r=await t.text(),n=document.createElement("script");n.textContent=r,document.head.appendChild(n)}catch(i){}}Q().catch()}customElements.get("am-omnibus-listing")||customElements.define("am-omnibus-listing",class extends HTMLElement{static get observedAttributes(){return["data-am-rendered"]}connectedCallback(){this.renderOnce()}disconnectedCallback(){this.cancelRender(),delete this.dataset.amRendered}attributeChangedCallback(e,t,r){null!==t&&null===r&&queueMicrotask(()=>this.isConnected&&this.renderOnce())}cancelRender(){this.amRenderGeneration=(this.amRenderGeneration??0)+1,this.amTooltipRenderer?.destroy(),this.amTooltipRenderer=null}renderOnce(){!this.dataset.amRendered&&(this.dataset.amRendered="true",this.cancelRender(),this.replaceChildren(),e(this))}})})();
</script>
```

**6. Render the snippet in price.liquid**

Locate `price.liquid` in the snippets, paste `{%- render 'am-lowest-price', product:product -%}` at the end, and save (we recommend using this snippet, since it is responsible for displaying the price).

> [!NOTE]
>
> Some third-party themes may use a different product variable name, which can cause the `price.liquid` code to not work. If you encounter this issue, try `{%- render 'am-lowest-price', product:target -%}`, `{%- render 'am-lowest-price', product:product_resource -%}` or `{%- render 'am-lowest-price', product:product_ref -%}`. If none of these work, please contact us for assistance at [help-center@amasty.com](mailto:help-center@amasty.com).

![Render line added to price.liquid](https://guide.amasty.com/media/.renditions/wysiwyg/Shopify_Omnibus/2025-09-25-11-44-28.png)

The result on the front-end:

![Lowest price block on the collections page](https://guide.amasty.com/media/.renditions/wysiwyg/omni12.png)

> [!NOTE]
>
> If you uninstall the app, it won't automatically undo the changes. You'll need to manually delete any unnecessary info or blocks.

## Add the lowest price block to the related products block

**1. Open the theme code editor**

Head to the theme settings, and then click on **Edit code**.

![Edit theme code to add the lowest price block to related products](https://guide.amasty.com/media/.renditions/wysiwyg/omni6.png)

**2. Open Snippets**

In the theme editor sidebar, find and click on the **Snippets** section to expand the list of existing snippet files.

**3. Create a new file**

At the top of the expanded list, you will see a button labeled **New File**. Click this button to create a new snippet file.

![New File button](https://guide.amasty.com/media/.renditions/wysiwyg/Shopify_Omnibus/edit-code-side-bar-161.png)

**4. Name the snippet**

A text field will appear where you can enter a name for your new snippet. Name it `am-lowest-price-for-related-products.liquid` and press **Enter**.

![Snippet name for related products](https://guide.amasty.com/media/.renditions/wysiwyg/Shopify_Omnibus/2025-09-25-11-59-30.png)

**5. Add the code**

On the right side of the screen, in the tab corresponding to the new snippet, **add the content below** to the code text field and **save**.

```liquid expandable theme={null}
<script type="application/json" id="am-omnibus-related-texts-{{ product.id }}">
    {
        "label": {{ shop.metafields["omnibus_insight"]["am_lowest_price_label"].value | json | replace: '<', '\u003c' }},
        "popupIconText": {{ shop.metafields["omnibus_insight"]["am_lowest_price_icon_text"].value | json | replace: '<', '\u003c' }},
        "promotionPeriod": {{ shop.metafields["omnibus_insight"]["am_lowest_price_promotion_period"].value | json | replace: '<', '\u003c' }}
    }
</script>
<div id="am-omnibus-related-container-{{ product.id }}" style="position: relative; z-index: 1"></div>
<img alt="" width="0" height="0" style="display: none" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" onload='(async()=>{var e,t,r;let{shop:n,locale:i,currency:l,country:o}=window.Shopify;if(!n)return;let a={AR:"es",AZ:"az",BG:"bg",DE:"de",ES:"es",FI:"fi",FJ:"fj",FO:"fo",FR:"fr",HR:"hr",HT:"ht",HU:"hu",ID:"id",IS:"is",IT:"it",LT:"lt",LV:"lv",MG:"mg",MH:"mh",MK:"mk",MN:"mn",MT:"mt",NL:"nl",NO:"no",PL:"pl",PT:"pt",RO:"ro",RU:"ru",RW:"rw",SK:"sk",SO:"so",TH:"th",TO:"to",TR:"tr",US:"en",UZ:"uz"},s=(e,t)=>a[t]||(e||"").split(/[-_]/)[0]||e,c=(e,{marginTop:t=null,marginBottom:r=null}={})=>{let n=e||"";return null!==t&&(n=n.replace(/margin-top:\s*-?\d+px/,`margin-top: ${t}px`)),null!==r&&(n=n.replace(/margin-bottom:\s*-?\d+px/,`margin-bottom: ${r}px`)),n},u=(e,t,r)=>{let n=e.querySelector("#"+t);if(!n)return;let i=e.querySelector(".am-omnibus-promotion");i||((i=document.createElement("div")).className="am-omnibus-promotion",e.insertBefore(i,n)),i.innerHTML=r||"";let l=void 0!==n.dataset.amOmnibusMarginTop;r?(l||(n.dataset.amOmnibusMarginTop=n.style.marginTop),n.style.marginTop="0px"):l&&(n.style.marginTop=n.dataset.amOmnibusMarginTop,delete n.dataset.amOmnibusMarginTop)},p=["a","b","strong","i","em","u","br","span","p","small","sub","sup"],_=["http","https","mailto"],m=["href","target","rel"],d=["style","class"],$=e=>String(e??"").replace(/[&<>\x22\x27]/g,e=>{let t=String.fromCharCode(38+(e.charCodeAt(0)-e.charCodeAt(0)));switch(e){case"&":return t+"amp;";case"<":return t+"lt;";case">":return t+"gt;";case`"`:return t+"quot;";default:return t+"#039;"}}),f=e=>{let t=document.createElement("textarea");return t.innerHTML=e,t.value},h=e=>{let t=f(String(e).trim()).replace(/[\x00-\x1f\x7f]/g,"").trim();if(""===t||t.startsWith("/")||t.startsWith("#")||t.startsWith("//"))return!0;let r=t.indexOf(":");return -1===r||_.includes(t.slice(0,r).toLowerCase())},b=e=>{let t={},r=/([a-zA-Z][\w-]*)(?:\s*=\s*(?:\x22([^\x22]*)\x22|\x27([^\x27]*)\x27|([^\s\x22\x27`=<>]*)))?/g,n;for(;null!==(n=r.exec(e));)t[n[1].toLowerCase()]=n[2]||n[3]||n[4]||"";return t},y=(e,t)=>{let r="a"===e?m:d,n={};for(let i of Object.keys(t))r.includes(i)&&(n[i]=t[i]);return"a"!==e||(void 0===n.href||h(n.href)||delete n.href,void 0!==n.target&&"_blank"===n.target.toLowerCase()&&(n.rel="noopener noreferrer")),n},g=e=>Object.keys(e).map(t=>` ${t}="${$(e[t])}"`).join(""),C=e=>e.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)(\s[^>]*)?\s*\/?>/g,(e,t)=>p.includes(t.toLowerCase())?e:""),w=(e,t,r)=>{let n=t.toLowerCase();if(e.startsWith("</"))return`</${n}>`;let i=y(n,b(r||"")),l="br"===n||e.trimEnd().endsWith("/>");return l?`<${n}${g(i)} />`:`<${n}${g(i)}>`},A=e=>{let t=String(e??"").trim();if(""===t||!t.includes("<"))return t;let r=t,n=!1;for(let i=0;i<10;i++){let l=C(r).trim();if(l===r){n=!0;break}r=l}return n?r.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)(\s[^>]*)?\s*\/?>/g,(e,t,r)=>w(e,t,r)):$(r)},v=(e,t,r,n,i)=>{if(e)return e;let l=t;if(r&&r.length>0)for(let o of r)o.code&&(o.code===n||n.startsWith(o.code+"-"))&&o[i]&&(l=o[i]);return l},x=e=>A(e).replaceAll("\n","<br>"),T="{{ product.id }}";if(!T||void 0===window.ShopifyAnalytics)return;let S=e=>"string"==typeof e&&""!==e?e:null,L=()=>{try{let e=JSON.parse(document.getElementById(`am-omnibus-related-texts-${T}`).textContent);return{label:S(e.label),popupIconText:S(e.popupIconText),promotionPeriod:S(e.promotionPeriod)}}catch(t){return console.error(t),{label:null,popupIconText:null,promotionPeriod:null}}},E=L(),O="{{ product.selected_or_first_available_variant.price }}"*.01,j="{{ product.selected_or_first_available_variant.compare_at_price }}"*.01,k=Number("{{ localization.market.id }}"),H=Number("{{ customer.current_company.id }}"),I=`am-price-trends-${T}`,M=e=>{if("null"!==e)try{return JSON.parse(e)}catch(t){console.error(t)}return null},P=M(`{{ shop.metafields["app--80349265921"].am_lowest_price_settings.value | json }}`),Z=M(`{{ product.metafields["app--80349265921"].am_lowest_price.value | json }}`),z=M(`{{ product.selected_or_first_available_variant.metafields["app--80349265921"].am_lowest_price.value | json }}`),F=P?.custom_font_url?"AmCustomFont_{{ shop.id }}":null;if(F&&!window.amOmnibusCustomFontLoaded){window.amOmnibusCustomFontLoaded=!0;let N=document.createElement("style");N.textContent=`@font-face {font-family: ${F};src: url("${P.custom_font_url}");font-display: optional;}`,document.head.appendChild(N),"undefined"!=typeof FontFace&&new FontFace(F,`url("${P.custom_font_url}")`).load().then(e=>document.fonts.add(e)).catch(()=>{})}let B=null,R="{{ product.selected_or_first_available_variant.id }}",{page:U}=window.ShopifyAnalytics.meta,{pageType:W}=U;if("product"!==W||+T===window.ShopifyAnalytics?.meta?.product?.id)return;let q=async e=>{let t=l?.active;if(!t)return null;let r=(e,t)=>{try{if(!t){localStorage.removeItem(e);return}let r={value:t,timestamp:Date.now()};localStorage.setItem(e,JSON.stringify(r))}catch(n){}},i=e=>{try{let t=localStorage.getItem(e);if(!t)return null;let{value:r,timestamp:n}=JSON.parse(t),i=Date.now();if(i-n<432e5)return r;return localStorage.removeItem(e),null}catch(l){return null}},o=`am_omnibus_rate_${t}_${e}`,a=i(o);if(a)return a;let s=await fetch("/apps/am-omnibus-price",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({shop:n,operation:"currency_conversion",currency:l,lowestCurrency:e})});if(!s.ok)return null;let{rate:c}=await s.json();return r(o,c),c},V=async(e,t)=>{if("object"!=typeof e)return;let r=(e,t)=>{if(!t)return e.settings;if(e.hasCustomSettings){for(let r in t)r in e.settings||(e.settings[r]=t[r]);return e.settings}return t},n=r(e,t);if(!n||"object"!=typeof n)return;let l=`#am-omnibus-related-container-${T}`,a=document.querySelectorAll(l);if(!a||0===a.length)return;let{show_lowest:p,display_mode:_,popup_content:m,display_only_at_discount:d,percentage_mode:$,multi_currency_display_mode:f,period:h,languages:b,translations:y,css:g,icon_size:C,shop_currency:w,positive_percentage_color:A,negative_percentage_color:S,excluded_market_ids:L,excluded_company_ids:M}=n;if(!p)return;if(H){if(M&&M instanceof Array&&(M.includes(H)||M.includes(""+H)))return}else if(k&&L&&L instanceof Array&&(L.includes(k)||L.includes(""+k)))return;let P=w||e.shopCurrency,Z=window.Shopify?.currency,z=Z?.active,F=Z?.rate,N,B,R,U,W=null,V=e.markets,D=null;H&&V?.companies?.[H]?D=V?.companies?.[H]:k?D=V?.markets?.[k]:o&&(D=V?.countries?.[o]);let J=D?D.prices:null,Q=D?D.lowest:null;if(J&&Q){let Y=J&&z?J[z]?.original:null;if(Y)N=Y.amount,U=Y.currency;else{if(!Q.original?.amount)return;P===Q.original?.currency?(N=Q.original.amount*F,U=z):(N=Q.original.amount,U=Q.original?.currency)}B=O,R=!!(j&&j>O)}else N=e.lowest_price,e.currency===z?(U=z,B=O,R=!!(j&&j>O)):(U=e.currency,B=e.price,R=!!e.at_discount);if(U&&U!==P){if(!Z||"object"!=typeof Z)return;if(z&&U===z)F=1;else if(z&&P===z){if(N*=F=Z.rate,1==+F&&U!==z)switch(f){case"hide":return;case"original":W=U;break;default:if(!(F=await q(U)))return;N*=F,F=1}}else switch(f){case"hide":return;case"original":W=U;break;default:if(!(F=await q(U)))return;N*=F,F=1}}if(null==N){"popup"===_&&"price_only"!==m&&G(_).catch(),a.forEach(e=>u(e,I,""));return}if(d&&!R){a.forEach(e=>u(e,I,""));return}let ee=g;if("popup"===_){let et=v(E.popupIconText,y.icon_text,b,i,"iconText");if(a.forEach(e=>{X(e,m,g,C||20,et)}),"price_only"!==m){G().catch();return}g=""}let er=B<N,en=B>N,ei="inherit",el="";if(en)el="+",ei=A||"rgb(214, 123, 123)";else if(er){el="-";let eo="rgb(110, 221, 168)";ei=S&&S!==eo?S:"popup"===_?"rgb(16, 172, 132)":eo}let ea=`color: ${ei}`,es,ec;0!==N?ec=` <span style="${ea}">(${el}${es=Math.abs(es=parseFloat(es=(B/N-1)*100).toFixed(2))}%)</span>`:(es=0,ec=""),("dont"===$||"positive"===$&&er||"zero_or_negative"===$&&en||0===es)&&(ec=""),W?z=W:z&&z!==P&&F&&1!=+F&&(N*=F);let eu=(e,t,r,n)=>{let i={style:"currency",currency:n,numberingSystem:"latn"},l=new Intl.NumberFormat(r?`${t}-${r}`:t,i).format(e);return l.includes(n)&&(l=new Intl.NumberFormat(t,i).format(e)),"USD"!==n&&/(?<![A-Za-z])\$/.test(l)&&(l+=` ${n}`),l},ep=eu(N,s(i,o),o,z);ep||(ep=`${N} ${z}`);let e_=v(E.label,y.lowest,b,i,"text");e_||(e_=`The lowest price from last ${h} days: {lowest.price}`),e_.includes("{X}")&&(e_=e_.replaceAll("{X}",h)),e_=x(e_);let em="",e3=e.promotion;if(e3&&!(e3.ends_at&&new Date(e3.ends_at)<=new Date)){let ed=v(E.promotionPeriod,y.promotion_period,b,i,"promotionPeriod");if(ed){let e$=e=>{let[t,r,n]=String(e).split("-").map(Number),l=new Date(Date.UTC(t,r-1,n));return new Intl.DateTimeFormat(i||void 0,{year:"numeric",month:"long",day:"numeric",timeZone:"UTC"}).format(l)};ed=(ed=(ed=x(ed)).replaceAll("{start_date}",e$(e3.start_date))).replaceAll("{end_date}",e3.end_date?e$(e3.end_date):"");let e0=c(ee,{marginBottom:2});em=`<p class="caption" style="${e0}">${ed}</p>`}}let ef=em?c(g,{marginTop:0}):g,e5;e5=e_.includes("{lowest.price}")?`<p class="caption" style="${ef}">${e_=e_.replaceAll("{lowest.price}",`${ep}${ec}`)}</p>`:`<p class="caption" style="${ef}">${e_}: ${ep}${ec}</p>`,"popup"===_&&"price_only"===m?(K(I,e5,m).catch(),a.forEach(e=>u(e,I,em))):a.forEach(e=>{e.innerHTML=em+e5})},D=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;if("object"==typeof(e=P)&&e&&Object.keys(e).length>0&&Object.keys(P).some(e=>"custom_font_url"!==e)){if(R&&null!==z&&"object"==typeof(t=z)&&t&&Object.keys(t).length>0)return V(z,P);if(null!==Z&&"object"==typeof(r=Z)&&r&&Object.keys(r).length>0)return V(Z,P)}async function G(e){let t=`#am-omnibus-related-container-${T}`,r=document.querySelectorAll(t);if(!r||0===r.length)return;let a=await fetch("/apps/am-omnibus-price",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({shop:n,productId:T,variantId:R,locale:i,currency:l,country:o,companyId:H,marketId:k,realPrice:O,realComparePrice:j,labelTemplate:E.label,popupIconTemplate:E.popupIconText,promotionTemplate:E.promotionPeriod})});if(!a.ok)return;let{lowestPriceHtml:s,displayMethod:c,popupContent:p,prices:_,plainCss:m,iconSize:d,iconText:$,chartColor:f,promotionHtml:h}=await a.json();null!=s&&(e&&(c=e),r.forEach(e=>{if(c&&"always_visible"!==c){if(!s){u(e,I,"");return}X(e,p,m,d||20,$),u(e,I,h);let t=null;"chart"===p&&(t="https://cdn.shopify.com/extensions/01a1e9c5-bb5b-7b2b-a9d4-f0dc308bad26/omnibus-insight-price-tracker-28/assets/chart.js"),K(I,s,p,_,t,f).catch()}else e.innerHTML=(h||"")+s,void 0===c&&!s&&B&&B.destroy()}))}async function K(e,t,r,n,l,a){let s=await J();(B=new s(e,t,r,n,l,a,o,i,F)).render()}function X(e,t,r,n,i){if(e.querySelector(`#${I}`))return;let l=document.createElement("div"),o="#111111",a="12px",s="left";l.id=I,r&&(l.style.cssText=r,o=l.style.color,a=l.style.fontSize,s=l.style.textAlign),e.style.textAlign=s,l.style.display="inline-flex",l.style.alignItems="center";let c="default";"chart"===t&&(c="pointer"),l.style.cursor=c;let u=document.createElement("p");u.innerText=[void 0,null].includes(i)?"Price trends":i,u.style.margin="0 0 0 6px",u.style.borderBottom=`2px dotted ${o}`,u.style.fontSize=a,u.classList.add("caption");let p=ee(o,n),_=et(o,n);l.appendChild(p),l.appendChild(_),l.appendChild(u),e.appendChild(l)}async function J(){return(void 0===window.AmOmnibusTooltip&&(window.AmOmnibusTooltip={}),window.AmOmnibusTooltip.instance)?Promise.resolve(window.AmOmnibusTooltip.instance):(window.AmOmnibusTooltip.promise||(window.AmOmnibusTooltip.promise=new Promise((e,t)=>{let r="am-tooltip-lib:loaded",n=i=>{let l=i.detail,{AmOmnibusTooltip:o}=l;document.removeEventListener(r,n),o?(window.AmOmnibusTooltip.instance=o,e(o)):t(Error("Could not load AmTooltip lib"))};document.addEventListener(r,n),Q()})),window.AmOmnibusTooltip.promise)}function Q(){Y("https://cdn.shopify.com/extensions/01a1e9c5-bb5b-7b2b-a9d4-f0dc308bad26/omnibus-insight-price-tracker-28/assets/tooltip.js").catch()}async function Y(e){try{let t=await fetch(e),r=await t.text(),n=document.createElement("script");n.textContent=r,document.head.appendChild(n)}catch(i){}}function ee(e="#111111",t=20){let r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("width",t),r.setAttribute("height",t),r.setAttribute("viewBox","0 1 16 14"),r.setAttribute("fill","none");let n=document.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M6.5 3.5C6.5 3.08579 6.83579 2.75 7.25 2.75C7.66421 2.75 8 3.08579 8 3.5V3.75H8.75C9.16421 3.75 9.5 4.08579 9.5 4.5C9.5 4.91421 9.16421 5.25 8.75 5.25H6.5C6.22386 5.25 6 5.47386 6 5.75C6 6.02614 6.22386 6.25 6.5 6.25H7.5C8.60457 6.25 9.5 7.14543 9.5 8.25C9.5 9.35457 8.60457 10.25 7.5 10.25V10.5C7.5 10.9142 7.16421 11.25 6.75 11.25C6.33579 11.25 6 10.9142 6 10.5V10.25H5.25C4.83579 10.25 4.5 9.91421 4.5 9.5C4.5 9.08579 4.83579 8.75 5.25 8.75H7.5C7.77614 8.75 8 8.52614 8 8.25C8 7.97386 7.77614 7.75 7.5 7.75H6.5C5.39543 7.75 4.5 6.85457 4.5 5.75C4.5 4.64543 5.39543 3.75 6.5 3.75V3.5Z"),n.setAttribute("fill",e);let i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d","M14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7ZM12.5 7C12.5 10.0376 10.0376 12.5 7 12.5C3.96243 12.5 1.5 10.0376 1.5 7C1.5 3.96243 3.96243 1.5 7 1.5C10.0376 1.5 12.5 3.96243 12.5 7Z"),i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("fill",e),r.appendChild(n),r.appendChild(i),r}function et(e="#111111",t=20){let r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("width",t),r.setAttribute("height",t),r.setAttribute("viewBox","2 -4 14 18"),r.setAttribute("fill","none"),r.setAttribute("xmlns","http://www.w3.org/2000/svg");let n=document.createElementNS("http://www.w3.org/2000/svg","path");return n.setAttribute("fill-rule","evenodd"),n.setAttribute("clip-rule","evenodd"),n.setAttribute("d","M5.44697 1.5C5.00114 1.5 4.61903 1.81867 4.53896 2.25725L3.53735 7.74387C3.2988 9.05057 2.16035 10 0.832058 10H0.75C0.335786 10 0 9.66421 0 9.25C0 8.83579 0.335786 8.5 0.75 8.5H0.832058C1.43583 8.5 1.95331 8.06844 2.06174 7.47448L3.06335 1.98787C3.27353 0.836541 4.27661 0 5.44697 0C6.71534 0 7.76907 0.978167 7.86328 2.24304L8.57919 11.8548C8.60629 12.2186 8.90939 12.5 9.27423 12.5C9.61494 12.5 9.90571 12.2537 9.96172 11.9176L10.4817 8.7979C10.7027 7.47189 11.8499 6.5 13.1943 6.5H15.25C15.6642 6.5 16 6.83579 16 7.25C16 7.66421 15.6642 8 15.25 8H13.1943C12.5832 8 12.0617 8.44177 11.9613 9.0445L11.4413 12.1642C11.2648 13.2236 10.3482 14 9.27423 14C8.12419 14 7.16876 13.1131 7.08334 11.9662L6.36743 2.35445C6.33154 1.87262 5.93013 1.5 5.44697 1.5Z"),n.setAttribute("fill",e),r.appendChild(n),r}G().catch()})();this.parentNode.removeChild(this);' />
```

**6. Render the snippet in price.liquid**

Open `price.liquid` in the snippets and paste `{%- render 'am-lowest-price-for-related-products', product:product -%}` at the end, and save (we recommend using this snippet, since it is responsible for displaying the price).

> [!NOTE]
>
> Some third-party themes may use a different product variable name, which can cause the `price.liquid` code to not work. If you encounter this issue, try `{%- render 'am-lowest-price-for-related-products', product:target -%}`, `{%- render 'am-lowest-price-for-related-products', product:product_resource -%}` or `{%- render 'am-lowest-price-for-related-products', product:product_ref -%}`. If none of these work, please contact us for assistance at [help-center@amasty.com](mailto:help-center@amasty.com).

> [!NOTE]
>
> If you uninstall the app, it won't automatically undo the changes. You'll need to manually delete any unnecessary info or blocks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.