Skip to content

Storefront template docs: close documentation gaps#11

Merged
alexphelps merged 4 commits intomainfrom
storefront-docs-gap-fixes
Mar 24, 2026
Merged

Storefront template docs: close documentation gaps#11
alexphelps merged 4 commits intomainfrom
storefront-docs-gap-fixes

Conversation

@next-devin
Copy link
Contributor

Summary

Comprehensive update to storefront template documentation addressing gaps identified through a systematic audit. The existing docs covered ~40% of the template API surface area actually used by themes — this PR closes the critical gaps so a developer can build a functional theme from the docs alone.

Tags added (6)

  • cart_form — generates add-to-cart forms (every product page needs this)
  • core_js — platform core JS bundle (every theme needs this)
  • add_query_param — pagination and filter URL building
  • render_field / annotate_form_field — form rendering helpers
  • purchase_info_for_line — cart line pricing (complements existing purchase_info_for_product)

Objects added (7)

  • cart — shopping cart with all properties (totals, taxes, discounts, subscriptions)
  • line — cart line items (price, quantity, discounts)
  • session — the object returned by purchase_info_for_product (price + availability)
  • variant_form — product variant selection
  • filters — category page faceting (price_range, boolean, list types)
  • subscription_group — subscription cart groupings
  • user — authentication state

Filters added (2)

  • currency — price formatting (used on every price display, was completely undocumented)
  • split — string splitting

URLs added

  • Homepage (templates/index.html)
  • Cart actions (cart:add, cart:saved, cart:vouchers-add, cart:vouchers-remove)
  • Customer/auth (customer:login, customer:logout, customer:summary, customer:support-ticket-create)
  • Localization (set_language, core:set-currency, core:set-storefront)
  • API (storefrontapi:graphql)

Structural improvements

  • Per-template context table — maps every template to its available view-specific variables
  • Dashboard cross-reference table — maps template variables to their dashboard config paths (Settings > Branding, Storefront > Navigation, Settings > Policies, etc.)
  • Cart template context section — documents all cart-specific context variables

Fixes

  • Broken link: /docs/storefront/api/docs/storefront/graphql in cdn-and-caching.mdx
  • Typo: support:cateogry-listsupport:category-list
  • filters.md added to meta.json pages array (was missing from sidebar)

Review notes

All additions are based on actual usage patterns extracted from the Intro Bootstrap theme. Property tables, types, and descriptions reflect what templates actually consume. Code examples are copy-pasteable and follow existing doc conventions.

The gap analysis document (STOREFRONT_DOCS_GAP_ANALYSIS.md) is NOT included in this PR — it was used as the working plan and remains local only.

Test plan

  • Verify docs build (npm run dev) with no errors
  • Check new sections render correctly in sidebar and on page
  • Review property tables against actual platform behavior
  • Confirm code examples are syntactically correct
  • Verify cross-links between tags ↔ objects resolve

🤖 Generated with Claude Code

Addresses gaps in template tags, objects, filters, and URL references
for theme development. Changes include:

Tags: cart_form, core_js, add_query_param, render_field,
annotate_form_field, purchase_info_for_line

Objects: cart, line, session, variant_form, filters (faceting),
subscription_group, user, cart template context variables

Filters: currency (price formatting), split

URLs: homepage, cart actions, customer/auth, localization endpoints,
GraphQL API endpoint, typo fix (support:category-list)

Structural: per-template context table showing what variables each
view provides, dashboard cross-reference table mapping template
variables to their dashboard configuration paths

Fixes: broken /docs/storefront/api link, filters.md missing from
meta.json sidebar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@alexphelps alexphelps assigned alexphelps and unassigned alexphelps Mar 23, 2026
@alexphelps alexphelps self-requested a review March 23, 2026 05:11
Addresses review feedback: cart, line, subscription_group, and user
objects removed from template documentation. These represent per-user
data that is incompatible with full-page caching (keyed by URL +
language + currency). All cart and user interactions must use the
Storefront GraphQL API via client-side JavaScript.

Kept cache-safe objects: session (product pricing), variant_form,
filters (URL-param driven, public data).

Added prominent callout directing developers to GraphQL API for
cart and user data.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kilo-code-bot
Copy link

kilo-code-bot bot commented Mar 23, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Other Observations
  • The previously identified template syntax error in filters.md (extra closing brace in pluralize example) has been fixed in this PR. The old broken code You have { num_messages }} message {{ num_messages|pluralize }} is now correctly rendered as You have {{ num_messages }} message{{ num_messages|pluralize }}.

  • The existing inline comments about recommending Storefront GraphQL API for cart/user data have been addressed with the new warning Callout added to the Template Contexts section in objects.mdx.

Files Reviewed (6 files)
  • content/docs/apps/guides/dispute-service.mdx - typo fixes ("Fulifllment" → "Fulfillment")
  • content/docs/storefront/themes/cdn-and-caching.mdx - API reference improvement
  • content/docs/storefront/themes/templates/filters.md - syntax fix + new filters (currency, split)
  • content/docs/storefront/themes/templates/meta.json - added filters to pages array
  • content/docs/storefront/themes/templates/objects.mdx - typo fix ("it's" → "its") + new objects (session, variant_form, filters) + template contexts table + dashboard cross-reference
  • content/docs/storefront/themes/templates/tags.mdx - new tags (add_query_param, annotate_form_field, cart_form, core_js, purchase_info_for_line, render_field)
  • content/docs/storefront/themes/templates/urls-and-template-paths.mdx - typo fix (support:cateogry-list → support:category-list) + new URL documentation

All changes are documentation improvements: typo fixes, new API documentation, and structural enhancements. No issues found.

🤖 Generated with Claude Code


Reviewed by minimax-m2.5-20260211 · 207,265 tokens

@alexphelps alexphelps merged commit 418e638 into main Mar 24, 2026
4 checks passed
@next-devin next-devin deleted the storefront-docs-gap-fixes branch March 24, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants