How to add the lowest price widget to the related products block?

How to add the lowest price widget to the related products block?

The steps below will help you to add he lowest price block to the related products section:

1. Proceed to Online Stores > Themes and click the Customize button on your theme. Then head to the theme settings, and then click on 'Edit code'.



2. After that, in the sidebar menu under Snippets, select 'Add a new snippet'.



3. Name it 'am-lowest-price-for-related-products' and click 'Done'.



4. In the open window, paste the provided content and save.

<div id="am-omnibus-container-{{ product.id }}"></div>
<img alt="lowest price" width="0" height="0" style="display: none" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" onload='(async()=>{const t="product",{shop:i,locale:o,currency:n}=window.Shopify;if(!i)return;const e="{{ product.id }}";if(void 0===window.ShopifyAnalytics)return;const{page:a}=window.ShopifyAnalytics.meta,{pageType:c}=a;if((c!==t||e!=window.ShopifyAnalytics?.meta?.product?.id)&&c===t){const t="/apps/am-omnibus-price",a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({shop:i,productId:e,variantId:"{{ product.selected_or_first_available_variant.id }}",locale:o,currency:n})});if(!a.ok)return;const{lowestPriceHtml:c}=await a.json();if(!c)return;const r=`am-omnibus-container-${e}`,s=document.getElementById(r);if(!s)return;s.innerHTML=c}})(),this.parentNode.removeChild(this);'/>

5. 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).



Once the snippet changes are saved, the result will render as here:


If you are having difficulties to locate the required snippet or the lowest price doesn't appear on the collections page on your side, please, submit a ticket with us and we will be happy to offer further assistance.