Copied to clipboard

Flag this post as spam?

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


  • Rohan 105 posts 162 karma points
    Sep 15, 2014 @ 12:18
    Rohan
    0

    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 ?

    Thanks,

    Rohan Dave

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Sep 15, 2014 @ 14:10
    Alex Skrypnyk
    0

    Hi Rohan,

    The best way is to store price just in the decimal field and than format it to the needed way in frontend.

  • Rohan 105 posts 162 karma points
    Sep 15, 2014 @ 14:14
    Rohan
    0

    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 ?

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Sep 15, 2014 @ 14:27
    Alex Skrypnyk
    0

    You can use 'Numeric' datatype or create your own.

  • Rohan 105 posts 162 karma points
    Sep 15, 2014 @ 14:40
    Rohan
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies