You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faststore/components/features/delivery-promise/implementation.mdx
+9-42Lines changed: 9 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,13 @@
1
1
---
2
-
title: "Delivery Promise"
2
+
title: "Implementing Delivery Promise"
3
+
updatedAt: "2025-08-15T14:36:33.694Z"
3
4
---
4
5
5
6
>ℹ This feature is in closed beta, which means that only selected customers can access it. If you are interested in implementing it in the future, please contact our [Support](https://support.vtex.com/hc/en-us) team.
6
7
7
8
In this guide, you’ll learn how to configure Delivery Promise in your FastStore project.
8
9
9
-
**Delivery Promise** is a feature that provides accurate and reliable delivery estimations for available products based on the customer location. It ensures that customers only see products that are in stock and can be delivered to their address or picked up at nearby locations.
10
-
11
-
This solution continuously updates product availability throughout the buying journey by responding to changes in catalog, pricing, inventory, or shipping settings. These updates are then sent to [Checkout](https://developers.vtex.com/docs/guides/checkout-overview) and [Intelligent Search](https://help.vtex.com/tracks/vtex-intelligent-search), ensuring customers see up-to-date options based on their region.
12
-
13
-
This feature introduces new hooks as part of the regionalization and location workflow:
14
-
15
-
-`useRegion`: Accesses or updates the user's region information, such as postal code or location.
16
-
-`useRegionModal`: Handles modal display logic for region selection, especially when the location input is required.
17
-
-`useGeoLocation`: Uses the browser’s geolocation API or other client-side methods to attempt to auto-detect the user's location.
10
+
To understand how Delivery Promise operates, see the guide [Delivery Promise (Beta)](https://developers.vtex.com/docs/guides/faststore/features-delivery-promise-overview).
18
11
19
12
## Default settings
20
13
@@ -29,8 +22,8 @@ deliveryPromise: {
29
22
},
30
23
```
31
24
32
-
-`enabled`: When set to **true**, Delivery Promise activates, allowing the store to provide delivery estimates based on the user’s location.
33
-
-`mandatory`: When set to **false**, providing a postal code is optional for the user. Users can browse and add items to the cart without entering their postal code, though the accuracy of delivery information may be limited.
25
+
*`enabled`: When set to **true**, Delivery Promise activates, allowing the store to provide delivery estimates based on the user’s location.
26
+
*`mandatory`: When set to **false**, providing a postal code is optional for the user. Users can browse and add items to the cart without entering their postal code, though the accuracy of delivery information may be limited.
34
27
35
28
## Before you begin
36
29
@@ -111,11 +104,11 @@ Run the `faststore cms-sync` command to sync the `cms` folder of your FastStore
111
104
112
105
The expected response is that you receive the message `CMS synced successfully...`. The native regionalization components and sections will be automatically updated. You can check them in the VTEX Admin:
113
106
114
-
-**Regionalization component:** Go to *Storefronts > Headless CMS > Global Sections > NavBar > Navigation > Regionalization*.
107
+
-**Regionalization component:** Go to **Storefronts > Headless CMS > Global Sections > NavBar > Navigation > Regionalization**.
115
108
116
-
-**Region Bar section:** Go to *Storefronts > Headless CMS > Global Sections > Region Bar*.
109
+
-**Region Bar section:** Go to **Storefronts > Headless CMS > Global Sections > Region Bar**.
117
110
118
-
-**Region Modal section:** Go to *Storefronts > Headless CMS > Global Sections > Region Modal*.
111
+
-**Region Modal section:** Go to **Storefronts > Headless CMS > Global Sections > Region Modal**.
119
112
120
113
You only need to [add a new section](#step-3-adding-region-popover-section), the `Region Popover`.
121
114
@@ -316,7 +309,7 @@ Follow the steps below to add the `RegionPopover` section to the Headless CMS.
316
309
317
310
Learn more in [Adding Sections to the Headless CMS](https://developers.vtex.com/docs/guides/faststore/headless-cms-3-adding-content-types-and-sections#step-3-adding-sections-to-the-headless-cms)
318
311
319
-
### Step 4 - [Optional] Defining a default postal code
312
+
### Step 4 - (Optional) Defining a default postal code
320
313
321
314
The default postal code is a fallback mechanism when the user doesn't provide a location, isn't logged in, or has no saved address.
322
315
@@ -343,29 +336,3 @@ To set a default postal code for your store, follow the steps below:
343
336
person:null,
344
337
},
345
338
```
346
-
347
-
## Understanding location priority
348
-
349
-
To provide accurate Delivery Promise estimates, FastStore projects determine user location based on the following priority:
350
-
351
-
1.**User-provided location:** If the user provided their location, such as postal code, this information is used.
352
-
2.**Logged-in user’s address:** If the user hasn’t provided a postal code, we attempt to identify the location using the logged-in user's address.
353
-
3.**Default postal code:** If the user hasn't provided a location, isn’t logged in, or has no saved address, we check if the merchant has configured a default postal code for all buyers. Learn to do so in [Defining a default postal code](#step-4-optional-defining-a-default-postal-code).
354
-
4.**No postal code (not required):** If no postal code is provided and not required, products are displayed without using Delivery Promise.
355
-
5.**No postal code (required)**: If no postal code is provided when it's required, a modal is displayed that the buyer can't close until a postal code is entered. To make the postal code required, open your `discovery.config.js` file and change the `mandatory` field in the `deliveryPromise` object to `true`, as shown in the [Default settings](#default-settings) section.
356
-
357
-
To better understand how this flow works, see the following diagram.
358
-
359
-
```mermaid
360
-
graph LR
361
-
A{"User provided location?"} -- Yes --> B(["Use the provided location"])
362
-
A -- No --> C{"Logged-in user's address available?"}
363
-
C -- Yes --> D(["Use the logged-in user's address"])
364
-
C -- No --> E{"Default postal code configured?"}
365
-
E -- Yes --> F(["Use the default postal code"])
366
-
E -- No --> H{"Postal code mandatory?"}
367
-
H -- Yes --> K(["Display mandatory postal code modal"])
368
-
K --> L["User inputs postal code"]
369
-
L --> M(["Use the provided postal code"])
370
-
H -- No --> N(["Display products without using Delivery Promise"])
0 commit comments