# One storefront, every location: local stock and prices for each shopper

> How we built a Mage-OS and Hyvä store picker that shows each shopper their own store's products, prices, stock and hours from one Magento storefront.

URL: https://magento.zip/case-studies/multi-store-picker · Generated: 2026-10-30 03:31 UTC

A retailer with dozens of locations does not have one price list or one stock count. Each location carries its own range, its own prices and its own clearance items. A standard Magento catalog shows every shopper the same thing, so the website kept promising items that the shopper's nearest store did not have, at prices that store did not charge.

We built a store picker for a multi-location retailer. It turns one Mage-OS storefront into the right local store for each shopper: their location's products, prices, stock and opening hours, from the first page they see to the order confirmation.

### The challenge

The retailer's locations work almost like separate shops under one brand. The website had to respect that without becoming dozens of separate websites.

- **Different stock everywhere:** an item can be on the floor in one city and unavailable in the next. Showing it to everyone causes disappointed customers and support calls.

- **Different prices per location:** each store has its own price for an item, plus clearance prices that start and end on set dates.

- **Orders belong to one store:** stock is not moved between stores, so an order has to be tied to the store that will fulfil it. A shopper who wants to pick up in another city switches stores and buys from that store's stock.

- **Search had to agree with the store:** category pages, search results and filters all had to show only what the chosen location can sell, and still be fast.

- **Caching could not mix stores up:** a full-page cache that served one store's prices to another store's shoppers would be worse than no cache.

- **Search engines needed one stable version:** a crawler has no location, and indexed pages should not change price from one visit to the next.

- **The list of stores changes:** new locations open, and they come from the retailer's ERP, not from someone typing them into Magento.

### What we built

A set of Magento modules and a Hyvä front end that work together around one idea: **the shopper's selected store is part of every page.**

- **A store picker in the header:** it shows the selected store's city and today's hours, and opens a picker to change store from any page.

- **Nearest-store suggestions:** the picker suggests the closest locations from the shopper's approximate region and, if the shopper allows it, from their browser location. Distances are real driving distances, not straight lines, and the nearest store is highlighted.

- **Per-store catalog:** category pages, search results and filters list only products that exist at the selected store.

- **Per-store pricing:** each product shows the selected store's price, or its clearance price while a clearance runs. Bundles show as available only when every piece is in stock at that store.

- **Store-aware cart and orders:** the store is saved on the cart and the order, shown to the customer on their order page, and shown to staff in the admin order grid.

- **Store links:** a link can carry a store code, so a store's own marketing, a printed flyer or a product feed can send shoppers straight into that store's view.

- **Store pages:** each location has its own page at a readable address, with photos, a description, SEO meta and opening hours. Holiday hours are set as date-ranged templates.

- **A store editor in the admin:** staff manage addresses, map positions, hours and web visibility for every location in one grid.

### How it works

- **A shopper arrives.** If they have chosen a store before, it is restored from their browser and session. If not, the picker suggests nearby stores from their region. A shopper who allows location access gets the five closest stores by driving distance.

- **They pick a store.** The choice is saved in a cookie and in their session, so it holds across pages, visits and the checkout.

- **The catalog narrows to that store.** The search index holds a small set of fields for every location (exists, in stock, quantity, price, on clearance). Category and search queries filter on the selected store's fields, so filtering happens inside the search engine and stays fast.

- **Prices resolve for that store.** Product cards and product pages show the store's price. A clearance price applies automatically between its start and end dates, and a daily job refreshes the index so clearances switch on and off on time.

- **Pages are cached per store.** The full-page cache keeps a separate copy of each page for each store, so every shopper still gets cached speed and never sees another store's prices. The header's store name and hours load in a small separate request, so the cached page itself stays the same for everyone at that store.

- **The order goes to the right store.** The cart keeps the store's prices through checkout, and the order is saved with its store code for the team that fulfils it.

- **Crawlers get a stable view.** Known search-engine crawlers are pinned to one default store, so indexed pages always show consistent products and prices. Store links in product feeds render in place for crawlers instead of redirecting.

- **New stores arrive from the ERP.** A sync imports new locations from the retailer's ERP, honours its "show on web" flag, and never overwrites the details staff have corrected on the website. When a new store's stock is imported, the search index adds that store's fields on its own, so the new location is complete without manual work.

### Under the hood

- **Mage-OS (Magento 2 open source):** custom modules for store selection, per-store pricing and stock, store pages and the admin store editor, built on Magento's own extension points (plugins, observers, view models, cache context) rather than core edits.

- **Hyvä theme:** the header picker, the store picker and the store pages are Hyvä templates with Alpine.js components that pass a strict Content Security Policy.

- **OpenSearch:** per-store fields are added to the product search index, so per-store filtering and sorting run in the search engine, not in PHP.

- **The retailer's ERP (Microsoft Dynamics NAV):** the source of locations, per-store stock and per-store prices, brought in by scheduled imports and admin-triggered syncs.

- **Location services:** region detection from the visitor's connection, the browser's own location API (only with the shopper's consent), and a mapping service for driving distances. Distance results are cached for 30 days to keep lookups fast and API costs low.

- **Cron jobs:** daily clearance re-indexing, stock imports, and cache housekeeping.

- **Full-page cache with a store context:** one cached copy of each page per store, with the store-specific header details loaded separately.

### What it changed

We don't have before-and-after sales figures to share, so here is what the retailer can now do that a standard catalog could not:

- **One website, every location:** each store sells its own stock at its own prices from a single Mage-OS install, one admin and one catalog.

- **Shoppers see what they can actually buy:** listings, search and filters match the chosen store, so items that store cannot sell are not shown to its shoppers.

- **Clearances run themselves:** a clearance price is set once with its dates, and the site starts and ends it on schedule.

- **Orders arrive already assigned:** every order carries the store that will fulfil it, visible to staff in the order grid.

- **Opening a store is a data task, not a project:** a new location from the ERP shows up in the picker, gets its own store page, and its catalog fills in after its first stock import.

- **Other features build on the same choice:** once a store is selected, other parts of the site can use it too, such as answering store-hours questions or pre-selecting the shopper's store in a form.

### Could this work for you?

This pattern fits any business that sells from more than one place and whose places differ:

- retailers with showrooms or warehouses in several cities;

- franchise and dealer networks where each outlet sets its own prices or carries its own range;

- building-supply, farm and hardware chains that offer local pickup from local stock;

- wholesalers with regional depots that need regional price lists.

We build this kind of integration on Mage-OS and Hyvä, connected to the ERP or stock system you already run. If your store is still on Magento 1 or an older Magento 2 theme, we can move it first: see our Magento 1 to Mage-OS and Hyvä migration and Magento 2 to Mage-OS and Hyvä upgrade, or browse all migration options.

See what else we offer on our services page, or tell us about your locations and we will tell you how we would approach it.

## Links

- [Page](https://magento.zip/case-studies/multi-store-picker)
- [Store guide (llms.txt)](https://magento.zip/llms.txt)
