Shopify/Timber

No 'compare_at_price' for AjaxCart?

Closed this issue · 9 comments

In the returned cart.js JSON there doesn't seem to be a 'compare_at_price' to be used.

I think you're looking for original_price

Unfortunately not. original price is showing the new price... not the original price.

screen shot 2016-11-21 at 16 17 26 1

screen shot 2016-11-21 at 16 18 05

Very strange. I'm looking into it and will get back to you when I know more.

@cshold Thanks! I will keep looking too.

Looks like this is the expected behaviour. compare_at_price is not returned in the Liquid line_item (part of the cart object) either - source.

What use case do you have to show off the compare at price in the cart?

Yeah I thought it was strange it wasn't returned. I wonder why it's considering 'less important' for the cart?

I'd just like to be as clear with visitors as possible... when it's in the cart and shows the discounted price it would be nice to show how much they're saving/original price etc (whereas currently I can only do this with compare_at_price). I would've thought original_price would've worked... strange that all the prices show the discounted price.

That's the only use case I was thinking of too. It would certainly add confusion though when you add in cart discounts. With that, you'd have your original price (compare_at_price), price of the product (price), and then the discounted price (discounted_price).

Yeah that's a good point. But I see that as a separation between product and cart discount but I think it could still add confusion. Ah well... if it's not part of the API and therefore not possible then ah well but thanks for the replies and explanations.

Thanks for helping me learn more about cart discounts!