Copied to clipboard

Flag this post as spam?

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


  • Richard Hamilton 36 posts 158 karma points
    Jun 11, 2020 @ 09:07
    Richard Hamilton
    0

    Saving hidden data in Node

    I am creating a shopping cart and want to save a node with the order

    Some details will be visible, name, etc

    But I also want to save some things that Umbraco users should not be able to see and if they try to edit it will break the order.

    Ie. I have the full order with line items, prices as a Json string. I want to save that to a field that is hidden from the user but I can use it again to regenerate the order in a user readable format.

    Any suggestions? At the moment I am using a label but it shows as [Object][Object]

  • Steve Morgan 1349 posts 4458 karma points c-trib
    Jun 11, 2020 @ 10:44
    Steve Morgan
    0

    My first thoughts are are you really sure these orders should be in the content tree.

    Each update will cause a publish event, the history of orders and therefore the db will grow quickly.

    It sounds to me like you should have a custom section and a custom set of tables (order, order lines).

    If you're happy still going down the content route then a custom property editor is probably the way to go. You can store your json string, even do something clever checking for a user group perhaps to display.

    HTH

    Steve

  • Richard Hamilton 36 posts 158 karma points
    Jun 11, 2020 @ 11:29
    Richard Hamilton
    0

    Thanks Steve I am using the Node tree at the moment as I need to get this out the door quickly.

    I'm sure Tea-commerce used to do this?

    Its also a fairly small concern. not turning over thousands of orders per day / week. But could refactor this later to make it more scalable.

Please Sign in or register to post replies

Write your reply to:

Draft