Skip to main content

Shortcodes & Tags

Join Markt is not Shopify Liquid. Developers use four surfaces:
  1. Nunjucks tags{% markt_component %}, {% markt_snippet %}
  2. Nunjucks context + filtersproducts, store, shopUrl, formatPrice, …
  3. Helpershelpers.components.products.getItemsByIds(items, ids)
  4. HTML embed attributesdata-markt-* buy buttons on external sites
  5. Vite / React — TypeScript + storefront API (no template tags)
API version: MARKT_NUNJUCKS_API_VERSION 1.0.0 — see Nunjucks Theme API.

Display products (Nunjucks)

Homepage / products grid (groups-aware)

Prefer catalogItems so group cards appear once and grouped products are not duplicated:
Context comes from buildMarktStorefrontContext(). Use standaloneProducts for ungrouped-only lists; use full products for detail pages and group members.

Limit for homepage

Current product page

On templates/product.njk, use product (or null if missing).

Platform tags

Legacy imported themes may use {% render_component %} / {% render_snippet %} via the optional markt.sellauth extension — native themes should use markt_* only.

Core filters


Cart (theme + platform)

Cart source of truth: browser localStorage key cart (appCart).
  • Add: appCart.add(productId, variantId, quantity) — skip when product.visibility == 'on-hold'
  • Resolve lines: GET /api/v1/cart?storeId=&shopId=&cart=
  • Checkout: theme checkout() using appCart.itemsPOST /api/v1/checkout/checkout/{orderId}
Use camelCase fields (product.image, product.slug, variant.quantityMin). There is no {% markt_cart %} tag — cart is JS + API.

Embed buy shortcodes (external HTML)

For merchant sites outside the theme (Webflow, custom HTML). Load the embed script, then use product CUID attributes — not Liquid tags.
JS API: Markt.init(), Markt.open({ items, theme }), Markt.close(). Dashboard → product → Embed Checkout generates snippets. Demo: /embed/demo.html.

Vite / React (no {% %} shortcodes)

Visual Builder sections map to React components; sellers edit content in the dashboard.

Anti-patterns

  • Inventing Shopify-style {% product_grid %} Liquid tags
  • Looping raw products for the homepage when groups exist (duplicates)
  • Allowing Add to cart on visibility === 'on-hold'
  • Putting | json inside x-data="..." or HTML attributes without encoding
  • Dumping full product descriptions into <head> scripts
  • Redefining Alpine.data('cartPage')
  • Hardcoding prices that ignore the catalog API
  • Custom card payment forms inside the theme
  • Calling /api/dashboard/* from the public storefront
  • Using SellAuth snake_case field names in native themes
See Nunjucks Theme Pitfalls.