Skip to main content
Glama
product.md3.86 kB
# Liquid Object: Product ## Overview The `product` object represents a product in the Shopify store. ## Properties ### Basic Information - **title** (string): The product's name - **handle** (string): The URL-friendly identifier of the product - **id** (number): The unique product identifier - **vendor** (string): The product's maker or supplier - **type** (string): The product's category classification - **description** / **content** (string): Detailed product information ### Availability & Status - **available** (boolean): Returns true if at least one variant is purchasable - **gift_card?** (boolean): Indicates whether the product is a gift card - **has_only_default_variant** (boolean): Returns true if the product has no options ### Pricing - **price** (number): The lowest variant price in currency subunits - **price_min** (number): Equivalent to `price` - **price_max** (number): The highest variant price - **price_varies** (boolean): Returns true if variant prices differ - **compare_at_price** (number): Lowest compare-at price - **compare_at_price_min** (number): Same as `compare_at_price` - **compare_at_price_max** (number): Highest compare-at price - **compare_at_price_varies** (boolean): Returns true if compare-at prices vary ### Media - **featured_image** (image): The primary product image - **featured_media** (media): The primary product media asset - **images** (array of image): All product images - **media** (array of media): All product media, sorted by date added ### Collections & Organization - **collections** (array of collection): Collections containing the product - **category** (taxonomy_category): The product's taxonomy category - **tags** (array of string): Product tags (in alphabetical order) ### Variants & Options - **variants** (array of variant): All product variants (max 250 unpaginated) - **variants_count** (number): Total variant quantity - **options** (array of string): Product option names - **options_by_name** (object): Access specific options by name (case-insensitive) - **options_with_values** (array of product_option): Options with their available values - **first_available_variant** (variant): First purchasable variant - **selected_variant** (variant): Currently selected variant (product pages only) - **selected_or_first_available_variant** (variant): Selected or first available variant ### Selling Plans - **requires_selling_plan** (boolean): Returns true if all variants require a plan - **selling_plan_groups** (array of selling_plan_group): Applicable selling plans - **selected_selling_plan** (selling_plan): Currently selected plan - **selected_or_first_available_selling_plan_allocation** (selling_plan_allocation): Current or default allocation - **selected_selling_plan_allocation** (selling_plan_allocation): Selected plan allocation ### Administrative - **created_at** (string): Product creation timestamp - **published_at** (string): Product publication timestamp - **template_suffix** (string): Custom template name (if assigned) - **url** (string): Relative product URL (includes tracking params if recommended) - **metafields** (untyped): Applied metafields - **quantity_price_breaks_configured?** (boolean): Returns true if variants have tiered pricing ## Code Examples ### Displaying Product Options ```liquid {% if product.options.size > 0 -%} {% for option in product.options -%} - {{ option }} {%- endfor %} {%- endif %} ``` Output with data: ``` - Size - Strength ``` ### Accessing Specific Option Values ```liquid <label> Strength <select> {%- for value in product.options_by_name['strength'].values %} <option>{{ value }}</option> {%- endfor %} </select> </label> ``` Output: ```html <label> Strength <select> <option>Low</option> <option>Medium</option> <option>High</option> </select> </label> ```

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/florinel-chis/shopify-liquid-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server