Copied to clipboard

Flag this post as spam?

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


  • Edgar Rasquin 174 posts 467 karma points
    Feb 18, 2021 @ 11:37
    Edgar Rasquin
    0

    Custom field in billing address

    Hi,

    is it possible to add custom fields to the billing address? I would need to add the "taxnumber" as a mandatory field.

    Thanks

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Feb 18, 2021 @ 11:56
    Matt Brailsford
    0

    Hey Edgar,

    In terms of just literally adding extra fields, you can store whatever you want in an orders properties collection, so if you need to store your tax number, you can store that in a custom property on the order.

    I'm guessing there is more to this question than this though and you might be referring to showing it in the back office, or you might be referring to capturing the extra field with Vendr Checkout.

    If you need further info, please clarify where / how you wish to use that property.

    Matt

  • Edgar Rasquin 174 posts 467 karma points
    Feb 18, 2021 @ 12:01
    Edgar Rasquin
    0

    Hi Matt,

    thanks for your immediate reply.

    Yes, I would need to display it in various places:

    • VendrCheckoutReviewPage.cshtml
    • backoffice order
    • Confirmation Email

    Thanks

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Feb 18, 2021 @ 12:17
    Matt Brailsford
    100

    Hi Edgar,

    Ok, then:

    1) You can't extend Vendr.Checkout with custom properties. It is meant as a simple drop in solution for people that need a quick setup. As soon as you need anything custom, you'll need to create your own checkout flow. You can use the Vendr.Checkout source as a basis though as this is all on GitHub https://github.com/vendrhub/vendr-checkout. Essentially though, you'll need to add an extra field to capture "taxnumber" and then when you call AddProduct on the order, you'll pass this through as an additional property ( https://vendr.net/docs/core/1-4-0/reference/vendr-core/orderextensions/#addproduct-3-of-8 ).

    2) We don't have a way to extend the customer details dialog, but what you can do, and what we do on our vendr site is to display these extra properties in the "Addition Info" section in the bottom right hand side of the order edit screen. These can be added to using the order editor config file documented here https://vendr.net/docs/core/1-4-0/key-concepts/order-editor-config/ (You'll want to read this generally, but the bit specific to Additional Info is under the heading Additional Info Config Options)

    3) Assuming you are using the Vendr.Checkout OOTB email templates, again, you'll need to swap these for custom ones. You can copy the ones from Vendr.Checkout and update these to output the extra property you have captured. All emails have access to the order entity and so you can access the custom property you capture in it's properties collection. You can then render that out however you see fit.

    Hope this helps

    Matt

  • Edgar Rasquin 174 posts 467 karma points
    Feb 18, 2021 @ 17:11
    Edgar Rasquin
    0

    Hi Matt,

    1) do I need to uninstall vendr-checkout nuget package and instead add the Vendr.Checkout.csproj project to my Visual Studio solution?

    2) "Addition Info" section is fine for me

    3) I think I will manage to do so

    Thank you

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Feb 19, 2021 @ 09:41
    Matt Brailsford
    0

    Hi Edgar,

    You could fork the code for the Vendr.Checkout project and update this independently. You could then use it's build script to generate a bespoke package that you could then install over the top of the existing Vendr.Checkout package. I believe this should do the trick.

    Hope this helps

    Matt

  • Edgar Rasquin 174 posts 467 karma points
    Feb 22, 2021 @ 09:08
    Edgar Rasquin
    1

    Thank you Matt.

    Works as described!

    Have a nice day.

    Edi

  • Matt Brailsford 2958 posts 15629 karma points MVP 7x c-trib
    Feb 22, 2021 @ 09:10
    Matt Brailsford
    0

    Hey Edgar,

    Glad to hear you got it all working 👍

    Matt

  • 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