Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
is it possible to add custom fields to the billing address?
I would need to add the "taxnumber" as a mandatory field.
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.
thanks for your immediate reply.
Yes, I would need to display it in various places:
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
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
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.
Thank you Matt.
Works as described!
Have a nice day.
Glad to hear you got it all working 👍
Hi folks, I feel like I'm missing a few steps here and was hoping you can help...
Looking in the Vendr Orders: Commerce > Stored > Orders
I don't see these details (this is a standard install so far)
But I've continued on in the hopes that it would appear - and trying to test updating order.editor.config.js, I have added the following:
I've then added the following to VendrCheckoutInformationPage.cshtml to test it:
Does this automatically pickup the order properties and assign it to the order on postback or is there a custom controller I need to inherrit? And how would I go about implementing this?
Thank you for your help,
Properties don't automatically get added to an order, they need to be handled in surface controller that adds the product to the order. For Vendr checkout this is here https://github.com/vendrhub/vendr-checkout/blob/v2/dev/src/Vendr.Checkout/Web/Controllers/VendrCheckoutSurfaceController.cs#L132 but in order to handle custom properties, you'd need to run your own build to handle that additional property.
I guess it could be a nice feature for us to support defining custom properties somewhere to say there are some other custom properties to automatically add to the order. I'll add it to the issue tracker, but it's not going to get looked at till the new year now. In the meantime, as mentioned above, your only option is to run your own custom build handling the additional properties in the surface controller outlined above.
UPDATE: Vendr Checkout feature request is here https://github.com/vendrhub/vendr-checkout/issues/26
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted