SeriesPart 76 of Building a property procurement platform on MedusaView the cluster →
Medusa & ArchitectureArticle

A buyer shared four products yesterday. Which price and stock should the colleague see today?

How a Medusa comparison link preserves a shortlist while recalculating current price, stock, visibility and delivery context.

We Are Souk article cover: A buyer shared four products yesterday. Which price and stock should the colleague see today?
Souk EngineeringCommerce architectureAug 2026·9 min read
Key takeaways
  • Product comparison looks like a presentation feature: select a few cards, place their attributes in columns and highlight the differences.
  • In a B2B marketplace, the difficult question is not how to draw the table.
  • The client needed property teams to compare a small number of products, discuss the options and send the decision set to a colleague.
  • The link preserves the conversation.

The client problem

Product comparison looks like a presentation feature: select a few cards, place their attributes in columns and highlight the differences.

In a B2B marketplace, the difficult question is not how to draw the table. It is which commercial truth the table should show when somebody opens a shared link later, from another property context, after price or stock has changed.

The client needed property teams to compare a small number of products, discuss the options and send the decision set to a colleague. We built a comparison flow on Medusa that stores only product identities in the shareable URL, limits the set to four and reconstructs current price, availability and delivery context when the page is opened.

The link preserves the conversation. It does not freeze facts that the buyer should no longer trust.

The client problem is a shared purchasing decision

Maintenance procurement often starts with products that appear interchangeable. Two valves may serve the same purpose but use different units of measure. An appliance part may be cheaper yet arrive too late. A supplier may offer pickup for one item and shipping only for another. Technical specifications can decide whether either product fits.

Buyers normally compare these facts across tabs, spreadsheets or copied links. The work becomes harder when a technician needs a manager's opinion or a purchaser must document why one option was selected.

A comparison page creates a common decision surface. But it works only if the recipient sees the products they are still allowed to buy, with commercial facts appropriate to the active property.

That means comparison belongs inside the commerce architecture. A static table generated in the browser cannot answer the full question.

Bound the decision to four products

More columns do not always produce a better decision. On a desktop, ten products make every value hard to scan. On a phone, they make the page nearly unusable. They also multiply backend retrieval and pricing work.

We chose a maximum of four product IDs. The storefront comparison queue deduplicates the selection, preserves its order and refuses additions once the bound is reached. The backend applies the same limit when parsing the request.

This is a product decision reinforced by an API contract. The interface explains the constraint early, while the server prevents a modified URL from turning the endpoint into an unbounded batch query.

Four is enough to create a meaningful shortlist without pretending that a side-by-side matrix should replace catalogue search. Search narrows the universe; comparison supports the final trade-off.

Share identities, never copied commercial values

The shareable URL contains the chosen product IDs. It does not contain names, prices, stock counts or delivery promises.

That makes the link compact and durable. More importantly, it prevents a stale query string from masquerading as current commerce truth. When a colleague opens it, the application asks the backend to assemble the comparison again.

The local selection is scoped to the user and property in browser storage. Opening a link replaces the current queue with the sanitised set from the URL, so two colleagues can discuss the same shortlist without sharing an account.

Only the decision set travels. Authentication, property context and all commercial eligibility are resolved anew for the recipient.

Resolve catalogue facts and live commerce facts separately

A useful comparison needs two kinds of information.

Catalogue facts are relatively stable: product name, image, description, category, brand, manufacturer, unit of measure and technical specifications. The marketplace search document is well suited to retrieving these across several products.

Commercial facts are contextual and volatile: calculated price, variant inventory, backorder behaviour and current eligibility. Those must come from the live Medusa product context for the active market and customer.

The backend joins the two by product ID. A product appears only when both its authorised marketplace document and its live commerce record are available. Missing products are returned as unavailable IDs rather than reconstructed from old client data.

This prevents the comparison page from becoming a side door around catalogue visibility or pricing policy.

Reapply the active property's delivery geography

Delivery is not one universal number attached to a product. A supplier can serve one country, province, city or postal-code set differently from another. The active property determines which shipping options are relevant.

The comparison assembler filters delivery options against the property's country and, where required, province, city or postal code. It then derives the shortest known maximum shipping estimate from the applicable options.

Pickup remains a separate capability. The matrix can show whether an applicable pickup option exists without pretending that pickup and shipment describe the same fulfilment promise.

If no delivery estimate is known, the cell stays empty. It does not substitute “next day”, zero or another reassuring fiction. Unknown information is part of an honest decision surface.

Calculate availability from the variants Medusa returns now

Search indexes are excellent read models, but inventory can change after indexing. The comparison route derives availability from current variant data.

For inventory-managed variants, positive quantity produces in-stock or low-inventory states and zero produces out of stock. A variant that is not inventory-managed or allows backorders remains purchasable without inventing a physical count. If inventory information is incomplete, the output can remain unknown.

This distinction matters to buyers. “In stock”, “can be backordered” and “stock is not known” are not interchangeable statements.

The displayed stock level aggregates the usable variant information for the product. The matrix translates that into plain language rather than exposing implementation flags.

Compare prices only when the units make sense

The lowest number is not necessarily the cheapest option. A box of 100 and a single unit cannot be compared by raw price alone.

The interface highlights a lowest comparable price only when at least two products have the same normalised unit of measure and every compared price is present and positive. If units differ or a price is missing, it does not crown a winner.

That small rule prevents a visually persuasive but commercially wrong recommendation. The table still shows each known price and unit, allowing the buyer to make the appropriate conversion or investigate the supplier packaging.

The broader principle is valuable across procurement: comparison logic should refuse conclusions when the inputs do not share a meaningful basis.

Build rows around buyer questions

The matrix begins with purchasing questions rather than technical schema fields:

  • What will it cost in my current context?
  • In what unit is it sold?
  • Which supplier provides it?
  • Is it available?
  • How long could shipping take?
  • Is pickup possible?
  • Are brand, manufacturer or category different?
  • Which technical specifications differ?

Specification keys are normalised so variations in capitalisation do not create duplicate rows. Values remain attached to the correct product, and rows calculate whether the compared columns actually differ.

That allows the interface to emphasise differences without hiding common facts. A buyer can scan the exceptions first, then inspect the full detail when needed.

Preserve unknown values instead of filling the design

Comparison tables create visual pressure to populate every cell. That pressure is dangerous.

A missing delivery estimate does not mean immediate delivery. A missing inventory count does not mean zero. An absent specification does not prove that the product lacks the property; the catalogue may simply not state it.

We model unknowns as empty values and render them deliberately. This keeps absence distinct from a negative answer such as “pickup not available”. The difference is important when the page informs a real purchase.

The same approach improves data quality. Repeated empty fields can expose where supplier catalogue enrichment is needed, rather than being concealed behind made-up defaults.

Handle products that disappear between selection and review

A buyer can select a product on Monday and share the link on Wednesday. By then, one item may be unpublished, removed from the property's catalogue or unavailable from the authorised seller.

The comparison assembler walks the requested IDs in order and includes only products found in both the marketplace document set and live Medusa result. It reports the remainder as unavailable.

The interface can explain that a selected product is no longer available instead of failing the entire comparison or displaying stale information. The remaining shortlist still provides value.

This is another reason the URL stores IDs only: a product's former title and price cannot linger as an unofficial snapshot after its commercial visibility changes.

What the buyer gains

The final capability supports a real conversation:

  1. A buyer narrows search results to two, three or four candidates.
  2. The matrix aligns price, unit, supplier, stock, delivery and specifications.
  3. Unsupported conclusions, such as a cheapest product across different units, are withheld.
  4. The buyer shares the URL with a colleague.
  5. The colleague opens the same shortlist under current identity and property context.
  6. The platform recalculates volatile facts and flags products that are no longer available.

The decision remains collaborative without turning the link into a quotation or a promise that the marketplace cannot keep.

Why this belongs on an extensible commerce platform

Medusa supplies the live product, variant, pricing and inventory foundation. The project-specific marketplace layer supplies property scope, seller visibility, search documents and delivery geography.

We built the comparison at the seam between them. A generic frontend widget could display attributes, but it would struggle to enforce the same commercial rules as search and checkout. A static export could be shared, but it would age immediately.

Choosing an extensible engine allowed us to make the buyer-facing capability part of the real commerce model. The feature is easy to use precisely because the complex eligibility work remains server-side.

For the commerce team, this also means one less rule set to maintain. The comparison page does not invent its own definition of an eligible product and then drift away from search or checkout. It consumes the same contextual foundations, so improving catalogue visibility or delivery modelling improves the decision surface as well. That compounding effect is more valuable than a one-off comparison component.

If your B2B buyers compare products in spreadsheets because the storefront cannot preserve context, WeAreSouk can design a Medusa comparison flow that is shareable, current and commercially meaningful.

Read next
Keep the useful ideas coming

One practical commerce field note at a time.

Join the WeAreSouk journal for grounded stories about Medusa, Shopify, AI, integrations and the systems behind serious commerce.

Working on a similar problem?Bring us the business constraint. We’ll help map the system behind it.Talk to Souk →
Souk AI · online now

Turn the article into an implementation plan.

Ask how this applies to your store, your stack, or your current bottleneck.

01 Describe your current setup.02 Name the workflow or signal that feels unreliable.03 Get a practical first architecture back.
I can help map this article to your stack. Tell me what you sell, what platform you use, and where the medusa & architecture question hurts.
Continue the cluster

Building a property procurement platform on Medusa

Start a conversation

Tell us what commerce needs to do for your business.

No scheduling maze. Send the context, the constraint or the idea. We will read it and come back to you directly.