I don’t know if you can. The prices are stored in a dictionary with the key being the currency ID and the value being the price, which is what you are seeing. As far as I understand, the Umbraco list view assumes all values are simple value types so it’s just rendering the raw value. I don’t think they provide any way to transform the value before render.
For some scenarios you might get away with using the Currency ID key in your template, e.g. {{ value['currency-ID-key-here'] }}.
This will render the value as a number, e.g. 123456, but not in a nice formatted price, e.g. £123,456.00. I don't know whether you'd be able to take the template further.
This solution might not be practical if your listing prices in multiple currencies, but would serve for display the base/shop location price.
It would be nice if the official list view editor could allow you to define custom label angular templates as then you could easily override it's render behavior.
Showing the product price in a list view
I want to show the product price in a custom list view however the value is shown as a guid and the value.
Is there a value I need to use for the 'template' to display the price correctly?
Thanks.
Hi Sean,
I don’t know if you can. The prices are stored in a dictionary with the key being the currency ID and the value being the price, which is what you are seeing. As far as I understand, the Umbraco list view assumes all values are simple value types so it’s just rendering the raw value. I don’t think they provide any way to transform the value before render.
For some scenarios you might get away with using the Currency ID key in your template, e.g.
{{ value['currency-ID-key-here'] }}
.This will render the value as a number, e.g.
123456
, but not in a nice formatted price, e.g.£123,456.00
. I don't know whether you'd be able to take the template further.This solution might not be practical if your listing prices in multiple currencies, but would serve for display the base/shop location price.
custom list view plugin works
Haha, nicely done.
It would be nice if the official list view editor could allow you to define custom label angular templates as then you could easily override it's render behavior.
Great workaround though 👍
Hi seanrock,
ho did you manage to get it to work?
Thanks
EDIT:
I was looking for a package but you probably ment this, right?
https://24days.in/umbraco-cms/2016/custom-list-view-layouts/
Sorry for such a late response but yes, that article put us on the right path.
Hi
To be honest we didn't implement it in the end. The client didn't care.
is working on a reply...