how to configure price value at Umbraco so admin can add / remove any ?
Hi
On one of my webpage (cshtml) on frontend website , i need to add one dropdown which has some values like below
Price 1 - £25
Price 2 - £35
Price 3 - £45
Right i need this three values in my dropdown (cshtml) but in future it may be possible it will increase. I need to configure it at Umbraco side.
One way is , as I am aware about generating custom data type and i can generate dropdown kind of thing with some preadd value. So if admin want then they can enter any other value later on. But i don't know how to use that in (cshtml) or how to iterate through all the values of that custom data type in "cshtml".
Another way is, i can define one document type with two properties like Text and Value. Text will show "Price 1 , Price 2 and so on" and Value store "£25, £35 and so on". and later on on the (cshtml), i can loop through that document type and their nodes and get the values.
Now i want to know which one is good approch from above two ?
But let's say i have a 10 price category 1 , 2 , 3 up to 10. Each has different amouns lets say one has £25, another has £35, another has £45 and so on. So for each price category do you mean i need to add "Numeric" data types. ?
can i define one Document type and use it in (cshtml) by iterating on content node ?
how to configure price value at Umbraco so admin can add / remove any ?
Hi
On one of my webpage (cshtml) on frontend website , i need to add one dropdown which has some values like below
Right i need this three values in my dropdown (cshtml) but in future it may be possible it will increase. I need to configure it at Umbraco side.
One way is , as I am aware about generating custom data type and i can generate dropdown kind of thing with some preadd value. So if admin want then they can enter any other value later on. But i don't know how to use that in (cshtml) or how to iterate through all the values of that custom data type in "cshtml".
Another way is, i can define one document type with two properties like Text and Value. Text will show "Price 1 , Price 2 and so on" and Value store "£25, £35 and so on". and later on on the (cshtml), i can loop through that document type and their nodes and get the values.
Now i want to know which one is good approch from above two ?
Thanks,
Rohan Dave
Hi Rohan,
The best way is to store price just in the decimal field and than format it to the needed way in frontend.
Hi Alex
Thanks for the reply
But how to configure it at Umbraco side ? Do i need to document type , content etc on Umbraco ? So that user can add remove any price ?
You can use 'Numeric' datatype or create your own.
Okay
But let's say i have a 10 price category 1 , 2 , 3 up to 10. Each has different amouns lets say one has £25, another has £35, another has £45 and so on. So for each price category do you mean i need to add "Numeric" data types. ?
can i define one Document type and use it in (cshtml) by iterating on content node ?
Can you please let me know ?
Thanks
is working on a reply...