Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • seanrock 240 posts 461 karma points
    Jun 24, 2020 @ 07:29
    seanrock
    0

    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.

    enter image description here

    Is there a value I need to use for the 'template' to display the price correctly?

    Thanks.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 24, 2020 @ 07:49
    Matt Brailsford
    0

    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.

  • Neil Chapman 42 posts 169 karma points
    Jan 12, 2024 @ 13:29
    Neil Chapman
    0

    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.

  • seanrock 240 posts 461 karma points
    Jun 24, 2020 @ 11:04
    seanrock
    101

    custom list view plugin works

    enter image description here

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 24, 2020 @ 11:10
    Matt Brailsford
    0

    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 👍

  • Edgar Rasquin 326 posts 925 karma points
    Mar 26, 2021 @ 10:09
    Edgar Rasquin
    0

    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/

  • seanrock 240 posts 461 karma points
    Jan 12, 2024 @ 13:42
    seanrock
    0

    Sorry for such a late response but yes, that article put us on the right path.

  • seanrock 240 posts 461 karma points
    Mar 28, 2021 @ 16:35
    seanrock
    0

    Hi

    To be honest we didn't implement it in the end. The client didn't care.

Please Sign in or register to post replies

Write your reply to:

Draft