Three New Fields Added to Address
Starting from V9Preview5, for address searches in an external system, additional properties have been added to IAddress: Title, Subtitle, and Distance.
Title- main part of the addressSubtitle- auxiliary part of the addressDistance- distance to the address from the trading enterprise
These fields are used for addresses in the Line1 format and are intended to visually facilitate the search for the desired address in the “Add New Address” address search window.
Previously, the result of an address search was a single line (Line1), displayed on the screen in one font. Now the search result can be returned in two lines - the main part of the address (Title) and the auxiliary part (Subtitle). To enhance perception, different fonts are used for their display: the text from Title will be displayed larger, while Subtitle will be smaller.
To switch to addresses in the Line1 format and further utilize the advantages of the new fields, it is necessary to ensure the following:
- the new address format is selected in the BackOffice settings (Administration -> Trading Enterprise Settings -> Delivery Address Format -> Use New Address Format)
- the
Resto.Front.Api.Deliveryplugin is installed and functioning correctly - the
Resto.Front.Api.ExternalAddressServiceplugin is installed and functioning correctly
Next, it is necessary to create a delivery in the front end and click on the “Address” field in the “Client” tab, after which the “Add New Address” window will open. When entering an address, the value of the Title field will be displayed in the center if it is not equal to null, and below in a smaller font - the value of the Subtitle field.
If Title is equal to null, then the Line1 field is displayed.
The Distance field is not displayed explicitly, but it is used implicitly when sorting search results: currently, they are sorted in ascending order of distance. The starting point for measuring distance is considered to be the address of the trading enterprise.
Examples of creating an address with the new fields can be found in the SDK project SamplePlugin in the class EditorTester.cs: in the methods CreateDelivery and ChangeDeliveryOrderTypeOnCourier.