Hi Matt,
I am currently in the process of fixing my shipping email.
I noticed quickly that I did not have a filed of the state of the buyer, in case the buyer was located in the US.
However I could not find any info about where I can get the State from the Model.Order or Model.Country..
I tried searching for it in the documentation to no avail.
I also tried some things like what can be seen below.
Everything is working, except the "State".
For "States" you'll want to use the Region feature of Vendr. Regions are defined within a Country in the back office and can be retrieved from the ICountryService along with the countries. You'll want to render the Region dropdown much the same way as the country dropdown and then store it's value in the shipping infos RegionId property.
Hi Matt,
Im not sure if I understand what you are suggesting.
When using the Vendr Checkout Package I am now able to select a state when choosing the US as country. I just need to be able to retrieve the selected state when sending the email.
I am already able to retrieve all the other data in the form, but I am having some difficulties retrieving this one
Sure, and the Vendr Checkout uses Vendr Regions for State handling. So both shipping and billing info on the order object have a CountryId and a RegionId, where in the US the RegionId relates to a State.
To get the state in your email template, you'll need to get the region from the Vendr API
var region = VendrApi.Instance.GetRegion(Model.ShippingInfo.RegionId.Value);
Retrieve States from Model.Order or Model.Country
Hi Matt, I am currently in the process of fixing my shipping email. I noticed quickly that I did not have a filed of the state of the buyer, in case the buyer was located in the US.
However I could not find any info about where I can get the State from the Model.Order or Model.Country.. I tried searching for it in the documentation to no avail. I also tried some things like what can be seen below. Everything is working, except the "State".
Thanks in advance
Victor
Hi Victor,
For "States" you'll want to use the Region feature of Vendr. Regions are defined within a Country in the back office and can be retrieved from the
ICountryService
along with the countries. You'll want to render the Region dropdown much the same way as the country dropdown and then store it's value in the shipping infosRegionId
property.Hope this helps
Matt
Hi Matt, Im not sure if I understand what you are suggesting.
When using the Vendr Checkout Package I am now able to select a state when choosing the US as country. I just need to be able to retrieve the selected state when sending the email. I am already able to retrieve all the other data in the form, but I am having some difficulties retrieving this one
As can be seen on the picture.
Hi Victor,
Sure, and the Vendr Checkout uses Vendr Regions for State handling. So both shipping and billing info on the order object have a CountryId and a RegionId, where in the US the RegionId relates to a State.
To get the state in your email template, you'll need to get the region from the Vendr API
then render it's name like you do the country
Matt
Hi Matt, Thanks a lot. Got it fixed now :D
is working on a reply...