My theme doesn’t allow adding the block with the lowest price, what should I do?
It will be possible to add the required block in the product-price.liquid code. To proceed, follow the steps below:
1. Proceed to Online store > Themes > Customize > Edit Code.
2. Add a new snippet in the Snippets folder:
Insert the content below and save the snippet:
- <div id="am-omnibus-container-{{ product.id }}"></div>
<script>
(async () => {
const {shop, locale, currency} = window.Shopify;
if (!shop) {
return;
}
const productId = "{{ product.id }}";
if (!productId || typeof window.ShopifyAnalytics === "undefined") {
return;
}
const selectedVariantId = "{{ product.selected_or_first_available_variant.id }}";
const {page} = window.ShopifyAnalytics.meta;
const {pageType} = page;
if (pageType === "product") {
const endpoint = `/apps/am-omnibus-price`;
const response = await fetch(endpoint, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json"
},
body: JSON.stringify({
shop,
productId,
variantId: selectedVariantId,
locale,
currency
})
});
if (!response.ok) {
return;
}
const {lowestPriceHtml} = await response.json();
if (!lowestPriceHtml) {
return;
}
const selector = `am-omnibus-container-${productId}`;
const container = document.getElementById(selector);
if (!container) {
return;
}
container.innerHTML = lowestPriceHtml;
}
})();
</script>
Add the following line at the end of the product-price.liquid code:
{%- render 'product-page-lowest-price', product:product -%}
Once you save the changes, the application’s block should appear on the front end.
Related Articles
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 ...
The lowest price widget doesn't appear on my collection pages, what should I do?
The lowest price widget doesn't appear on the collection pages automatically, but you can insert it manually in the code of your theme. Below, we will elaborate on the steps to proceed: 1. Proceed to Online Stores > Themes and click the Customize ...
Can we set up different price lists for different markets?
Unfortunately, the moment, our solution doesn’t support price lists.
How does the Shopify Omnibus Insight: Price History app handle price increases and show the lowest price in the last X days?
If you increase the prices of your products permanently, the Omnibus Insight: Price History app will show the lowest price from the last X days, excluding the most recent price change. This means the oldest price may still display as the lowest ...
Does your solution work with B2B shared catalogues?
At the moment, our solution doesn’t support price lists, but we are currently working on adding this feature in future releases.