Getting Delivery Address Settings
v8
The V8 API has introduced the ability to retrieve address settings for the correct operation of delivery creation.
To do this, a property AddressShowTypeSettings was added to the restaurant settings IRestaurant.
How to get the new delivery address settings:
IRestaurant restaurant = PluginContext.Operations.GetHostRestaurant();
AddressShowTypeSettings addressShowTypeSettings = restaurant.AddressShowTypeSettings;
The addressShowTypeSettings will have the following fields:
-
UseNewFormat- whether to use the delivery address format with fields Line1 and Line2. -
UseLiveSearch- whether to use live search (DaData) for adding delivery addresses on SyrveFront. -
AddressShowType- what type of delivery address display is used in SyrveFront and Syrve Office.
Address display types:
LEGACY - Address format with fields “City”, “Street”, “House”, “Building”
CITY - Address format with fields “Where to deliver” (Line1), “Entrance”, “Floor”, etc.
INTERNATIONAL - Address style in the United Kingdom with Line1 and Line2
NOPOSTCODE - Address style of the UAE.
This functionality may be useful for the plugin to understand whether it can use the fields Line1 and Line2 for creating the delivery address when creating a delivery on SyrveFront.