Recommended price on product page displaying wrong price

ashley-rose
Tourist
7 0 0

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>

 Screen Shot 2021-09-22 at 1.15.22 pm.jpg

Replies 3 (3)
LitExtension
Shopify Partner
1935 317 391

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

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
ashley-rose
Tourist
7 0 0

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!

LitExtension
Shopify Partner
1935 317 391

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

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!