Good morning,
I would like to know if it’s possible, for example, for a Cosmetics store that has several physical locations and an Ecommerce site, to have the customer enter their zip code and then route the order to the nearest store’s inventory for faster delivery.
I saw that VTEX has the option to create franchises, but I wanted to know if there’s another simpler way to do this at no cost.
Best regards,
Higor
Good morning, @HigorDev!
So… There’s no way to prioritize stock and dock based on order location. The platform uses the following default rules:
Stock Priority:

Documentation: É possível definir prioridade de estoque em minha loja?
Dock selection:

In terms of logistics combination, the article below mentions that the following criteria are considered when calculating priority, in this order:
- Fewest number of shipments.
- Lowest shipping price, already accounting for applicable surcharges and promotions.
- Shortest delivery time, adding up the total cost time from the warehouse to the carrier plus overhead.
- The priority set on the dock, where the one with the highest value wins.
Beyond prioritization, there are other factors considered when choosing a stock location:
- Highest available quantity of the SKU.
- Shortest route time between stock and dock.
- Lowest route cost between stock and dock.
Documentation: How shipping calculation works
You can, in a way, “force” a stock location to have a better chance of being selected. For example: within your stock locations, set different processing times for the same dock, so as to give a “advantage” to the stock you want to prioritize. If all other conditions (cost times, dock priority, etc.) are equal, but one stock location has a shorter processing time than another, it will be prioritized.
Karina Mota
Field Software Engineer | VTEX
What’s your store’s URL?
Are these physical stores in the same city?
If they are, it gets tricky to find the closest one because the shipping carrier will have the same delivery time and price. But if they’re in different cities, then it’s much more straightforward.
If you have motorcycle courier delivery, then even if they’re in the same city, it could work, since couriers usually charge by distance.
But basically, the idea is for you to create a carrier + dock + stock for each physical store.
Good morning,
I am from the company Danny Cosmeticos, we have several stores in various cities, so I would like to direct each customer’s purchase to the nearest store, for example: a customer from Americana to the Americana store, from Araras to the Araras store, and so on.
Best regards,
Hello, Higor
Good afternoon!
I believe that, given the responses already shared here, you have some guidance on how to handle the shopping/shipping by geolocation part.
But, either way, as a complement to the answers already given to you, I’m sending you a video from the training we have on VTEX IO. Hopefully, it will help you with the geolocation side of orders.
In this module, we objectively demonstrate the shipping by geolocation feature, including polygon generation with coordinates (region, city, and more).
Here it is: https://youtu.be/vTFTWykfgmg
We hope this has helped a little more 