Liquid, JavaScript, themes, sales channels
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
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024