Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
On our product page the recommended products are displaying the wrong price.
For example, if the main product is $23.95, all of the recommended products are displaying a price of $23.95.
Below is the code for the recommended products.
Do you know why " <div class="product-price new">${item.price}</div>" is displaying the wrong price?
Thank you!
<script id="recommended-template">window.recommendedTemplate = function(item) {
return `<div role="listitem" class="grid-item full-width-mobile w-dyn-item">
<a href="${item.url}" class="grid-link-block w-inline-block">
<div class="grid-image-wrapper-no-hover"><img loading="lazy" src="${item.image}" alt="" class="grid-image"><img loading="lazy" index="1" src="" alt="" class="hover-image"></div>
</a>
<div class="grid-content-wrapper product-info-wrapper">
<h5 class="product-title stretch">${item.title}</h5>
<div class="vendor-text">${item.vendor}</div>
<div class="sale-price-wrapper">
<div class="product-price new">${item.price}</div>
</div>
<a href="${item.url}" class="button outline w-button">View</a>
</div>
</div>`
}</script></div>
Hi @ashley-rose,
You can change to: item.final_price . This is just a suggestion, because the code can be assigned a different value.
Or you can check by changing:${item} , it will return an array of data and you can find the key of the price there, then you just need to display it with item.key.
Hope it helps!
If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck
Hi @LitExtension, thanks for your reply! I tried both these options but unfortunately this didn't work. I can't find any way to include the correct price. For now, I will remove the price element from recommended products. Thanks for your efforts!
hi @ashley-rose,
You can send me the staff account, I will help you check it quickly. Or you can send me an email to this address: namphan992@gmail.com
is there any solution to this problem? I am facing the same issue
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025