Variables
Use the variables in the prompt so the ChatGPT could generate a response that includes specific details on your store, blog content, customer.
Global variables
These variables can be used throughout the entire store.
| Variable | Description |
|---|---|
| {{ global.input }} | the variable is for additional text entered into the prompt during manual usage of the prompt in the admin panel. |
| {{ store.name }} | store name. |
| {{ store.code }} | store code. |
| {{ store.locale }} | returns the locale label of the target Store View (example: English (United States), German (Germany), French (France)). The value is always taken from the Store to which the prompt/rule is applied, regardless of Get Variables' Values From. |
{{ store.variable_name }} variables are always taken from the target store view where the action is applied, regardless of Get Variables’ Values From. This lets you use a single prompt for all languages—it will insert each selected Store’s locale automatically. In rules, select specific Store Views; All Store Views affects only the admin area.
Product variables
To use all available product attributes in the prompt, use the {{ product.attributes }} variable. To use your own attribute, use its attribute code as shown in the table:
| Variable | Description |
|---|---|
| {{ product.name }} | name of the product. |
| {{ product.description }} | the product description. |
| {{ product.short_description }} | the product short description. |
| {{ product.meta_description }} | the product meta description. |
| {{ product.attribute_code }} | one specified product attribute. |
| {{ product.attributes }} | list of useful attributes. |
| {{ product.image }} | the main product image filename. When used, the actual image is sent to the AI provider for visual analysis. |
| {{ product.small_image }} | the small product image filename. When used, the actual image is sent to the AI provider. |
| {{ product.thumbnail }} | the product thumbnail filename. When used, the actual image is sent to the AI provider. |
| {{ product.images }} | array of all product media gallery images. When used, actual images are sent to the AI provider for visual analysis. Supports Liquid iteration and filtering (see examples below). |
| {{ product.attachments }} | array of files attached to the product via Mirasvit Attachment extension. Each item has filename, label, and tag fields. Supported file types (images, PDF, TXT, CSV) are sent to the AI provider. |
The attribute_code may vary for each store. You can find it under Store -> Attributes -> Product in the Attribute Code column.
Before using a custom attribute, make sure the attribute is available for promo rule conditions.
Ignored product attributes
Some product attributes are ignored because they are either not informative for content generation, frequently change, or cause issues. Check the ignored attributes list before using:
| Attribute | Description |
|---|---|
| status | the current status of a product, such as enabled, disabled, or out of stock. |
| sku | stock Keeping Unit (SKU) is a unique identifier for each product. |
| price | the retail price of the product. |
| visibility | defines how the product is visible on the storefront (e.g., catalog, search, or both). |
| new | indicates whether the product is considered new. |
| sale | indicates whether the product is currently on sale. |
| shipment_type | defines the type of shipping (e.g., flat rate, free shipping). |
| url_key | the URL key for the product, often used for creating clean URLs (e.g., /product-name). |
| msrp_display_actual_price_type | controls how the MSRP (Manufacturer's Suggested Retail Price) is displayed in relation to the actual price. |
| price_view | determines how price is shown on the product (e.g., as a range or as a single price). |
| page_layout | specifies the layout used for the product page (e.g., 1-column, 2-column). |
| custom_design | specifies a custom design for the product, often used for special promotions or events. |
| custom_layout | defines a custom layout for the product page to change how content is displayed. |
| gift_message_available | indicates if gift messaging is available for the product. |
| image_label | a label for the main product image, usually for accessibility or descriptive purposes. |
| small_image_label | a label for the small product image. |
| thumbnail_label | a label for the thumbnail image. |
| tax_class_id | determines the tax class assigned to the product, which affects how taxes are applied. |
| options_container | defines how the product's configurable options (e.g., size, color) are displayed. |
| quantity_and_stock_status | defines the quantity available and the stock status (in stock, out of stock, or backordered). |
| swatch_image | an image representing a product option such as color or size used in product swatches. |
| special_price | a special discounted price for the product, typically used for sales or promotions. |
| special_from_date | the start date for a special price promotion. |
| custom_layout_update_file | a custom layout update file that modifies the product page layout. |
Image and attachment variables
When a prompt includes image or attachment variables, the actual files are sent to the AI provider alongside the text prompt. The AI can then analyze visual content (product photos, spec sheets, etc.) to generate more accurate descriptions.
Supported file types: JPEG, PNG, GIF, WebP, PDF, TXT, CSV. Files are automatically converted to base64 and sent to all supported providers (OpenAI, Claude, Gemini).
Only images that appear in the rendered prompt are sent to the AI. Use Liquid's limit filter to control how many images are included:
{% for img in product.images limit:3 %}
{{ img.filename }}
{% endfor %}
If the variable is referenced but no filenames appear in the output (e.g., used only in a condition), all images are sent.
Filtering attachments by tag:
{% for att in product.attachments %}
{% if att.tag == 'instruction' %}{{ att.filename }}{% endif %}
{% endfor %}
Category variables
To use all available category attributes in the prompt, use the {{ category.attributes }} variable. To use your own attribute, use its attribute code as shown in the table below.
When using parent variables like {{ category.parent.attribute_code }}, the top-level category (root) is not available, so second-level child categories cannot inherit or use them. Use additional conditions to retrieve the correct data, for example:
{% if category.parent %}
Parent category data:
{{ category.parent.attributes }}
{% endif %}
| Variable | Description |
|---|---|
| {{ category.attribute_code }} | one product attribute. |
| {{ category.attributes }} | list of useful attributes. |
| {{ category.name }} | name of the category. |
| {{ category.description }} | the category description. |
| {{ category.parent.attribute_code }} | specified attribute from parent category. |
| {{ category.parent.attributes }} | all attributes from parent category. |
| {{ category.parent.name }} | name of the parent category. |
| {{ category.parent.description }} | the parent category description. |
| {{ category.products }} | returns an array of products that requires iteration. By default, it contains the first 10 products in the category, sorted by ID. |
| {{ category.image }} | the category image filename. When used, the actual image is sent to the AI provider. |
| {{ category.attachments }} | array of files attached to the category via Mirasvit Attachment extension. |
If your prompt uses the category.products variable and you need fewer than 10 items, add a limit to the loop:
Liquid example (take only 3 products):
{% if category.products and category.products.size > 0 %}
Products in this category:
{% for product in category.products limit: 3 %}
- {{ product.name }}: {{ product.short_description }}
{% endfor %}
{% endif %}
Ignored category attributes
Some category attributes are ignored because they are either not informative for content generation, frequently change, or cause issues. Check the ignored attributes list before using:
| Attribute | Description |
|---|---|
| is_active | indicates whether the category is active (enabled) or not. |
| url_key | the SEO-friendly URL key for the category, used in the category’s URL. |
| path | the full path of the category in the category tree, showing its hierarchy. |
| include_in_menu | defines whether the category is included in the store's navigation menu. |
| position | the position of the category in the category list, determining its order. |
| level | defines the level of the category in the category hierarchy (root, first level, second level, etc.). |
| children_count | the number of child categories under this category. |
| display_mode | defines how the category is displayed (e.g., as a list, grid, or with a static block). |
| landing_page | the custom landing page associated with the category (if applicable). |
| is_anchor | indicates if the category is an anchor category (i.e., allows products to be displayed directly within the category). |
| custom_use_parent_settings | indicates whether the category should use the settings from its parent category. |
| custom_apply_to_products | defines whether custom settings should be applied to products in the category. |
| custom_design | specifies a custom design for the category, often used for special promotions or events. |
| page_layout | specifies the layout used for the category page (e.g., 1-column, 2-column). |
| layout_update | a custom layout update for the category page, often used to modify the layout dynamically. |
| custom_layout_update | custom layout updates applied specifically to the category, modifying its page structure. |
| custom_layout_update_file | a file that contains custom layout updates for the category page. |
Blog variables
The extension supports only a limited number of blog extensions. Please check if your blog extension is available before using.
| Variable | Description |
|---|---|
| {{ post.title }} | title of the blog post. |
| {{ post.content }} | main content of the blog post. |
| {{ post.short_content }} | short content of the blog post. |
| {{ post.meta_title }} | meta title of the blog post. |
| {{ post.meta_description }} | meta description of the blog post. |
| {{ post.meta_keywords }} | meta keywords of the blog post. |
| {{ post.data }} | combined data of the blog post. |
| {{ post.image }} | the blog post featured image filename. When used, the actual image is sent to the AI provider. |
| {{ category.name }} | the category’s display name/title shown to users. |
| {{ category.content }} | the main body content of the category page (rich text/HTML). |
| {{ category.meta_title }} | the SEO meta title used for the category page. |
| {{ category.meta_description }} | the SEO meta description for the category page. |
| {{ category.url_key }} | the URL slug/key used to build the category page URL (e.g., mens-shoes). |
| {{ category.data }} | combined data of the blog category. |
Order variables
| Variable | Description |
|---|---|
| {{ order.id }} | the order increment ID. |
| {{ order.status }} | the current order status (e.g., pending, processing, complete). |
| {{ order.state }} | the current order state. |
| {{ order.grand_total }} | the order grand total (formatted with currency). |
| {{ order.subtotal }} | the order subtotal (formatted with currency). |
| {{ order.total_paid }} | the total amount paid (formatted with currency). |
| {{ order.total_due }} | the total amount due (formatted with currency). |
| {{ order.items }} | list of ordered items with name, SKU, price, quantity, and subtotal. |
| {{ order.comments }} | order status comments history. |
| {{ order.full_data }} | combined order data including all attributes, items, and comments. |
In addition to the variables above, you can use any order attribute as {{ order.attribute_code }} (e.g., {{ order.customer_email }}, {{ order.shipping_description }}). Price, amount, and total fields are automatically formatted with the order currency.
CMS Page variables
| Variable | Description |
|---|---|
| {{ page.title }} | the CMS page title. |
| {{ page.content_heading }} | the CMS page content heading. |
| {{ page.content }} | the CMS page content. |
| {{ page.attachments }} | array of files attached to the CMS page via Mirasvit Attachment extension. |
CMS Block variables
| Variable | Description |
|---|---|
| {{ block.title }} | the CMS block title. |
| {{ block.content }} | the CMS block content. |
Email Template variables
| Variable | Description |
|---|---|
| {{ email.subject }} | the email template subject. |
| {{ email.content }} | the email template content. |
Helpdesk variables
The extension supports only a limited number of helpdesk extensions. Please check if your helpdesk extension is available before using.
| Variable | Description |
|---|---|
| {{ ticket.subject }} | the subject/title of the helpdesk ticket. |
| {{ ticket.customer }} | customer full name. |
| {{ ticket.firstMessage }} | the content of the first message in the ticket. |
| {{ ticket.lastMessage }} | the content of the last message in the ticket. |
| {{ ticket.messages }} | the full conversation history including all messages in the ticket. |
| {{ user.first_name }} | agent first name. |
| {{ user.name }} | agent name. |
| {{ user.last_name }} | agent last name. |
Knowledge Base variables
The extension supports only Mirasvit Knowledge Base. Please check if your Knowledge Base extension is available before using.
| Variable | Description |
|---|---|
| {{ kb_category.name }} | the knowledge base category title. |
| {{ kb_category.content }} | the knowledge base category content. |
| {{ kb_category.meta_title }} | meta title of the knowledge base category. |
| {{ kb_category.meta_description }} | meta description of the knowledge base category. |
| {{ kb_category.meta_keywords }} | meta keywords of the knowledge base category. |
| {{ kb_category.data }} | combined data of the knowledge base category. |
| {{ kb_article.name }} | the knowledge base article title. |
| {{ kb_article.content }} | the knowledge base article content. |
| {{ kb_article.meta_title }} | meta title of the knowledge base article. |
| {{ kb_article.meta_description }} | meta description of the knowledge base article. |
| {{ kb_article.meta_keywords }} | meta keywords of the knowledge base article. |
| {{ kb_article.data }} | combined data of the knowledge base article. |
Brand variables
The extension supports only Mirasvit Brand. Please check if your Brand extension is available before using.
| Variable | Description |
|---|---|
| {{ brand.title }} | the brand page title. |
| {{ brand.description }} | the brand description. |
| {{ brand.short_description }} | short description of the brand. |
| {{ brand.meta_title }} | meta title of the brand page. |
| {{ brand.meta_description }} | meta description of the brand page. |
| {{ brand.meta_keywords }} | meta keywords of the brand page. |
| {{ brand.data }} | combined data of the brand page. |