Prerequisites
- Storefront data enabled - In the Stockful app, go to Settings > Storefront and enable storefront data
- App embed active - In the theme editor, go to App embeds and enable Stockful
Stockful Badge
The badge block displays stock status, urgency, velocity, and restock information for the current variant.Adding the block
- In your Shopify admin, go to Online Store > Themes > Customize
- Navigate to your product template
- In the product section, click Add block > Apps > Stockful Badge
- Drag the block to position it where you want the badge to appear
Settings
Shape
Controls the badge border radius:- Square - sharp corners
- Rounded - subtle rounding (default)
- Pill - fully rounded capsule
Colors
All color settings are optional. When left empty, the badge uses sensible defaults that work with most themes.- Background color - badge background (default: transparent)
- Text color - badge text (default: inherits from theme)
Status colors
Override the indicator dot color for each status:- In stock color - (default: green
#16a34a) - Low stock color - (default: orange
#ea580c) - Out of stock color - (default: red
#dc2626) - Selling fast color - only visible when “Show selling speed” is enabled (default: purple
#7c3aed)
Display toggles
| Toggle | Default | What it shows |
|---|---|---|
| Show status indicator | On | Colored dot reflecting the current stock status |
| Pulse animation | Off | Animates the indicator for low stock, out of stock, and selling fast. Only visible when “Show status indicator” is enabled |
| Show stock status | On | ”In Stock”, “Low Stock”, or “Out of Stock” text label |
| Show urgency (days left) | Off | ”X days left” based on days of supply |
| Show selling speed | On | ”Selling Fast” label when the variant has high velocity |
| Show units sold | Off | ”X sold in the last 30 days” |
| Show restock status | Off | ”Restocking soon” or “Restock on the way” |
How it works
The badge renders immediately using Liquid metafields - no JavaScript fetch is needed for the initial page load. When a customer selects a different variant, the badge updates dynamically via thewindow.stockful API.
“Selling Fast” logic: When “Show selling speed” is enabled and the variant’s velocity trend is selling_fast (ABC class A with positive velocity), the badge overrides the normal stock status to show a purple “Selling Fast” indicator instead.
Stockful Location Availability
The location block adds a button that opens a slide-out drawer showing per-location stock.Adding the block
- In the theme editor on your product template, click Add block > Apps > Stockful Location Availability
- Position the block near the add-to-cart button or product details
Settings
| Setting | Default | Description |
|---|---|---|
| Button text | (uses localized default) | Custom button label. When left empty, uses the translated default (e.g. “Check store availability”) |
| Button style | Secondary | Primary (filled), Secondary (bordered), or Plain (underlined text link) |
| Display mode | Drawer | Drawer (slides in from the right) or Modal (centered overlay, bottom sheet on mobile) |
| Maximum locations | 10 | Limit how many locations appear (1-50) |
| Show available quantity | On | When enabled, shows “X available” instead of “In stock” / “Out of stock” |
How it works
When the customer clicks the button, location data is fetched live from Shopify. Depending on the display mode, it either opens a drawer that slides in from the right, or a centered modal (which becomes a bottom sheet on mobile). Each location shows its name, city, and stock status. The locations shown are controlled by the storefront settings in the Stockful app:- Visible locations - choose which locations customers can see
Accessibility
Both drawer and modal modes include:role="dialog"andaria-modal="true"on the panelaria-hiddentoggled on open/close- Focus trap within the dialog while open
- Focus returns to the trigger button on close
- Escape key to close
- Backdrop click to close
- Body scroll lock while open
CSS customization
Both blocks render in the normal DOM (no shadow DOM) and inherit your theme’s fonts and colors. All visual properties can be overridden via CSS custom properties in your theme CSS:.stockful-badge, .stockful-badge__dot, .stockful-drawer__panel, etc.) with single-class selectors and no !important - making them easy to override in your theme.