Hello,
We want to add a field per user or – if easier – per address where business customers can add their VAT id. Besides we need a text field for remarks for every order.
The VAT id field would best fit into userprofile.User, and the remark field into order.Order.
But can you propose what would be the best way to show it a a form? Where in the checkout process would be the best place to ask for an optional VAT id without making an unnecessary extra step? When customer is being asked for the billing address? But what if it’s the same like the shipping address? The shipping address is only asked for for shippable products. Should it be part of an address form? Actually it belongs to the User object and not to the address. Maybe it should go to the step when the cart is shown.
The remark field belongs to the order. So that could be shown on the cart as well.
Probably I can somehow solve the task, but some hints how to do it best would be useful for me.
Hi @MacLake,
there is a checkout object that is passed between checkout views and it can be used to store any additional data. Personally, I think the "summary" view seems the most appropriate for adding the "remarks" field. Unfortunately, there are three different versions of this view, so you would have to add the field in each of them. I would add a new form containing the "remarks" field and in each of the summary views validate both address forms and the one with remarks field. Validated remarks would be stored in the checkout object and copied to a new order in checkout.create_order() method.
Regarding the VAT ID - in case of registered users, I think the most appropriate place would be the user's account view (maybe "Address book" or a new section), where you could add a form for saving the VAT ID. If you want to add it as a part of the checkout, I would go similarly as with the remarks field and add a new form and display it in the summary step.
To add to this, I would consider making VAT ID part of Address rather than the User model. Especially if you allow both B2C and B2B sales where some users may want to utilize both (sometimes ordering on behalf of a company and sometimes not).
Hi. Is there any chance the VAT ID field will be implemented soon, please? It is quite a common usage in many e-shops and required in invoices for billing/accounting purposes.
I solved this by adding new fields to address model, and editing file saleor/account/i18n.py
added to labels in meta of AddressForm here, also to CountryAwareAddressForm to I18N_MAPPING
Also, I edited the inclusion tag that displays addresses ;)
needs testing, but for now it worked.
Great @Houba28 can you share your commits, please?
I dont know how @eriktelepovsky. It is not in public repository.
Can you give me temporary read access to the repo then, please?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi @Houba28 @eriktelepovsky, have you implemented B2B features to Saleor, if yes I would be very interested to talk to you as we are looking for paid support to launch a B2B marketplace.
Most helpful comment
To add to this, I would consider making VAT ID part of Address rather than the User model. Especially if you allow both B2C and B2B sales where some users may want to utilize both (sometimes ordering on behalf of a company and sometimes not).