Home
Wiki
Home
Wiki
  1. 3. Reusables
  • Back to home
  • 1. Themes
  • Vs Code
    • Getting Started
  • Kitchenware
    • Layout
      • New Layout
      • Legacy Layout
    • Components
      • Announcement
      • Banner Carousel
      • Banner With Products Carousel
      • Blog Category List
      • Blog List
      • Brand List
      • Brands Carousel
      • Breadcrumb
      • Call To Action
      • Cart
      • Categories List
      • Change Password
      • Checkout
      • Cookie Manager
      • Filter list
      • Footer
      • Forgot Password
      • Form
      • Hero Carousel
      • Icon Block
      • Invitation
      • Last Visited Products
      • Layout
      • Login
      • Map
      • Nav Bar
      • Offer
      • Product Attachments
      • Product Attributes
      • Product Documentation
      • Product Expected
      • Product Modal
      • Products Block
      • Products Carousel
      • Product Single
      • Profile
      • Quote
      • Register
      • Related Products
      • Search
      • Stores
      • Subscribe Newsletter
      • Text with Image
      • Top Bar
      • Video
    • Reusables
      • Getting Started
    • Assets
      • Getting Started
    • SDK
      • Products
        • _findProductsByCategory
        • _findProductsByIds
        • _findProductsByTitle
        • _findProductsByFilter
        • _findProductsByCriteria
        • _findProductsAndCalculate
        • _findProductsThenCalculate
        • _getProductAttributeSet
        • _setLastVisited
      • Categories
        • _findCategoryTreeById
        • _findCategoriesByIds
        • _findCategoryByAlias
        • _findCategoryTreeByAlias
        • _getCategoryContent
      • Collections
        • _getCollectionContent
        • _findCollectionsByIds
        • _findCollectionsByIdsThenCalculate
      • Brands
        • _getBrandContent
        • _findBrandsByIds
      • Cart
        • _addToCartMulti
        • _addToCart
        • _setCart
        • _clearCart
        • _setCartListener
        • _removeFromCart
        • _calculateCart
      • Checkout
        • _startCheckout
        • _updateCheckout
        • _completeCheckout
      • Shopping Lists
        • _getShoppingLists
        • _updateShoppingList
        • _createShoppingList
        • _deleteShoppingList
        • _getShoppingListByAlias
      • Navigation
        • _getFooterMenu
        • _getHeaderMenu
      • Users
        • _getUserById
      • Utils
        • _calculateCurrency
        • _getCurrencySymbol
        • _getCulture
        • _subscribeToNewsletter
        • _findUnitsByIds
  • Noir
    • 0. Introduction
    • 6. FAQ
    • 1. Structure
      • _Overview
      • LayoutA.liquid
      • ComponentsList.liquid
      • Metas.liquid
      • CssVariables.liquid
      • Json.liquid
      • GoogleTagManager.liquid
      • StagingButton.liquid
    • 2. Components
      • _Overview
      • Announcement
      • BannerCarousel
      • BlogCategoryList
      • BlogList
      • BrandList
      • Breadcrumb
      • Cart
      • CategoriesList
      • ChangePassword
      • Checkout
      • CookieManager
      • FilterList
      • Footer
      • ForgotPassword
      • Form
      • IconBlock
      • Invitation
      • LastVisitedProducts
      • Login
      • Map
      • NavBar
      • Offer
      • ProductAttachments
      • ProductAttributes
      • ProductComparison
      • ProductDocumentation
      • ProductMixList
      • ProductsBlock
      • ProductsCarousel
      • ProductSingle
      • Profile
      • Quote
      • Register
      • RelatedProducts
      • SingleBlog
      • Stores
      • TextWithImage
      • ThankYouPage
      • TopBar
      • Wishlist
    • 3. Reusables
      • _Overview
      • Addresses
      • AddressForm
      • AnnouncementModal
      • BackToTop
      • BillingRetail
      • BlogPostingStructuredData
      • BrandListStructuredData
      • CollectionStructuredData
      • Company
      • General
      • Login
      • LoginModal
      • MonthlyTransactions
      • Offers
      • Orders
      • Payment
      • ProductAttachments
      • ProductAttributes
      • ProductComparisonButton
      • ProductComparisonFloatingButton
      • ProductGridItem
      • ProductGridItemClassic
      • ProductListItem
      • ProductModal
      • ProductStructuredData
      • ProfileInfo
      • PromptModal
      • Quotes
      • Register
      • Services
      • Shipping
      • ShoppingLists
      • ShoppingListsButton
      • ShoppingListsNavbar
      • StoresStructuredData
      • Toast
      • Transactions
      • Users
      • VariantContent
      • VariantContentClassic
      • WishlistButton
    • 4. Assets
      • Fonts
      • Images
      • Templates
      • Javascript
        • _Overview
        • theme.js
      • Css - Scss
        • _Overview
        • ThemeClasses
    • 5. SDK
      • _Overview
      • LiquidGlobals
      • ServicesSDK
  1. 3. Reusables

ProductStructuredData

Purpose#

ProductStructuredData emits Schema.org JSON-LD (Product/ProductGroup) and an AI-agent context block for a single product page, so search engines can produce rich results and LLM/agentic shopping consumers get a concise, high-density metadata block.

Where it's rendered#

Rendered from Components/ProductSingle/Default.liquid:
{% render 'Reusables\ProductStructuredData\Default', product: product, canonicalUrl: canonicalUrl, showPrices: showPrices %}

Inputs (Liquid render parameters)#

Named parameters:
product
The product object for the current product page.
canonicalUrl
The canonical URL used for url/mainEntityOfPage-style fields.
showPrices
Boolean; when false, price/offer blocks are omitted (e.g. B2B storefronts that hide prices).

Model shape (storefront example)#

{
  "id": "Product Id",
  "title": "Sample product title",
  "description": "<p>Sample description</p>",
  "sku": "Sample text",
  "mpn": "Sample text",
  "isSkuVisible": true,
  "isMpnVisible": true,
  "tags": ["sample-tag"],
  "brand": { "name": "Sample brand" },
  "mediaItems": [{ "link": "https://example.com/sample.jpg" }],
  "stockAvailability": { "label": "InStock" },
  "attributes": [{ "name": "Sample text", "attributeItemValue": "Sample text" }],
  "extraFields": [{ "label": "Sample text", "value": "Sample text" }],
  "productVariants": [
    { "id": "Variant Id", "title": "Sample text", "sku": "Sample text", "finalPrice": 25, "stockAvailability": { "label": "InStock" } }
  ],
  "startPrice": 25
}

Template behavior (Liquid + Alpine)#

Resolves currency from GlobalData.Company.Currency (defaults to EUR), and availability from product.stockAvailability.label / each variant's stockAvailability.label.
Emits @type: ProductGroup with a hasVariant array when product.productVariants.size > 1; otherwise emits @type: Product with a single offers block (falling back from the single variant's finalPrice to product.startPrice, or a bare productID when neither is available).
All string values pass through | serialize (JSON-encode + escape) so quotes in titles/descriptions can never break the JSON.
Also emits a second <script id="ai-agent-context" type="application/json"> block with a compact spec/variant/API-route summary aimed at LLM/agentic shopping consumers.
Renders nothing when product is null.

Data contract (JS runtime)#

No client-side runtime state; all data is read directly from the Liquid render parameters at render time.

JavaScript#

File: Reusables/ProductStructuredData/Default.js
Exposes: productstructureddatareusabledefault (currently an empty object)
The JSON-LD and agent-context blocks are fully server-rendered; the global only reserves a unique name in the concatenated componentscripts.js bundle.

Global Alpine stores#

None. This reusable does not read or update any Alpine store.

Services / API calls#

None. All data (product/pricing/availability) is passed in as render parameters; there are no client-side API calls.

Dependencies#

Liquid: Reusables/ProductStructuredData/Default.liquid
JS: Reusables/ProductStructuredData/Default.js
Translations: Reusables/ProductStructuredData/Default.json

Notes#

Both <script> blocks are omitted entirely when product is null.
The ai-agent-context block intentionally lists real API routes (livePricing, productData, addToCart) so agentic consumers can act on the data; keep these routes in sync if the underlying endpoints change.
Modified at 2026-07-24 07:43:32
Previous
ProductModal
Next
ProfileInfo
Built with