Joffre Ordinola Shopify Developer & E-commerce Specialist
|

Cloudflare Worker · GraphQL · Custom JS · 2024 · Watersports

Cloudflare Worker that detects the user's region and disables unavailable variants before a single wrong click.

Regional Inventory Filter

Problem:

Customers in the EU were accidentally purchasing US-only stock, leading to high refund rates and fulfillment errors across regions.

Solution:

A Cloudflare Worker detects the user's region via IP headers and queries the Shopify GraphQL API to disable swatches and the Add to Cart button for any variant not stocked in the nearest warehouse.

How it works:

The Worker intercepts every storefront request, reads the IP-based market header, and queries the Shopify Admin GraphQL API for variant-level inventory at each regional warehouse. The result is passed to a custom JavaScript asset on the frontend, which disables color swatches and the Add to Cart button for any unavailable variant, all before a single click.

Tools:

  • Cloudflare Workers
  • Shopify GraphQL Admin API
  • JavaScript

More projects

See all projects
B2B Wholesaler Hub

B2B Wholesaler Hub

A dedicated partner portal with access control, bulk ordering, and CLI-built UI extensions for verified wholesalers.

Cart AOV Optimizer

Cart AOV Optimizer

Real-time free shipping bar + metafield-driven upsell widget that hides products already in the cart.