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]
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.
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]
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
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.
is working on a reply...