Get 'compare_at_price' of each product in cart as separate value

maxson
Excursionist
17 0 1

Hello

I am currently trying to display the original price of each product (that was added to cart) on the cart page. Everything works like a charm, unfortunately only one last thing is bothering me. Normally all prices 'refresh' as soon as you change the quantity of a product. When this happens the value of every compare_at_price will be set to lowest 'compare_at_price'-value (the 'compare_at_price_min') of the current cart items. That's because 'compare_at_price' will always get the lowest value. Before changing the quanitity every value is assigned correctly.

Shopify.dev page is saying this:

product.compare_at_price

Returns the lowest compare at price of all the product's variants entered in the Shopify admin. This attribute is similar to product.compare_at_price_min.

If none of the product variants have a value for compare at price, product.compare_at_price will return nil.

Is there a way to get the 'compare_at_price' of each item itself? And not only the lowest one.

 

On first loadOn first load

After changing qtyAfter changing qty

 

Replies 0 (0)