Copied to clipboard

Flag this post as spam?

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


  • Philip Hayton 98 posts 435 karma points
    Jun 14, 2022 @ 22:53
    Philip Hayton
    0

    Is there a way to format the values on the additional information panel

    Hi Matt,

    Sorry it's me again...

    Is there any way to customize the template for the properties on the Additional Information panel? We'd like to format the dates, hide empty values, and provide a custom view for a JSON object.

    Is that possible at all?

    For info we have already set the view in editor.config but that seems to only apply to the edit overlay.

    These fields are quite confusing to the store managers

    The edit fields look slightly better

    If that's not possible then I may need to look into creating a custom order edit screen altogether, however that seems like a huge job 🙈

    Any help is greatly appreciated.

    TIA

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 15, 2022 @ 05:14
    Matt Brailsford
    0

    Hi Philip

    Hmm, I think your findings may be correct that there is no custom way atm to change the view when they are just being displayed.

    Maybe we need to introduce another view for display.

    Im currently at Codegarden so will have to review this when I return. The only other option really right now would be to use custom property editors for editing that stores values in a friendly displayable format.

  • Philip Hayton 98 posts 435 karma points
    Jun 15, 2022 @ 07:34
    Philip Hayton
    0

    Hi Matt,

    Yeah if there was a way to specify a view + config for the info panel that would be a perfect solution. 👍🏻

    Thanks for the quick reply and enjoy Codegarden! 🍻

  • Philip Hayton 98 posts 435 karma points
    Jun 15, 2022 @ 14:44
    Philip Hayton
    100

    For future self, and anyone else that needs to go down this path, it's actually not as much work as I expected to create a custom Order Editor.

    As the docs say you can override the entire order editor by addding a view key to storeAlias.order.editor.config.

    {
        view: "/my/custom/view.html"
    }
    

    So I simply copied the default order editor that ships with Vendr and bastardized it to my own ends. I ended up moving some of the panels around too which was a nice bonus.

    One thing that tripped me up is that you'll need to include all the keys from the default config. Seems obvious in hindsight but knowing this may save you a time. For example:

    {
        orderLine: { ... },
        customer: { ... },
        billing: { ... },
        shipping: { ... },
        notes: { ... }    
        additionalInfo: [{ ... }],
        view: "/my/custom/view.html"
    }
    

    I'm quite pleased with the outcome, it's great that Vendr allow you to do stuff like this. I'll have to make sure that future changed to the Vendr framework get ported across to the custom template though so something to beware of.

Please Sign in or register to post replies

Write your reply to:

Draft