<product-item> tag allows you to create dynamic product listings on your pages. It automatically loops through products that match your criteria and displays them using a template you define.
Overview
The product item tag is perfect for:- Product catalogs and listings
- Featured products sections
- Related products
- Category pages
- Upsell product displays
Basic Usage
Simple Product Listing
With Filtering
Attributes
Required Attributes
data-type
Filters products by type.
Values:
"any"- All product types (default if not specified)"physical"- Physical products only"digital"- Digital products only"service"- Service products only- Any other product type defined in your system
Optional Attributes
data-classification
Filters products by classification.
Values:
"any"- All classifications (default)"main"- Main products only"upsell"- Upsell products only"downsell"- Downsell products only"bump"- Bump products only- Any other classification defined in your system
data-codes
Filter by specific product codes (comma-separated).
Format: Comma-separated list of product codes
Example:
id
Optional element ID applied to each product wrapper.
Example:
Product Placeholders
Within the<product-item> template, you can use these placeholders to display product information:
Standard Product Fields
Use{product.field_name} to access standard product attributes:
{product.name}- Product name{product.code}- Product code{product.price}- Product price{product.description}- Product description{product.image_url}- Product image URL{product.type}- Product type{product.classification}- Product classification{product.currency}- Currency code{product.status}- Product status
Custom Product Attributes
Use{product.attributes.attribute_name} to access custom product attributes.
Example:
Filtering Examples
Filter by Type Only
Filter by Classification
Filter by Specific Codes
Combined Filters
Complete Example
Here’s a complete example of a product catalog page:How It Works
- Tag Detection: The system finds all
<product-item>tags in your page - Filter Application: Products are filtered based on
data-type,data-classification, anddata-codesattributes - Template Rendering: For each matching product, the template is rendered
- Placeholder Replacement: Product placeholders (
{product.*}) are replaced with actual product data - Output: Each product is wrapped in a
<div>with the specifiedid(if provided)
Best Practices
Performance
- Limit Results: Use specific
data-codeswhen you only need a few products - Filter Early: Use
data-typeanddata-classificationto reduce the product pool - Optimize Images: Ensure product images are optimized for web
User Experience
- Consistent Layout: Keep product card layouts consistent
- Clear Pricing: Always display price clearly
- Product Images: Include product images for better visual appeal
- Call-to-Action: Include clear CTAs (buy buttons, learn more, etc.)
Template Design
- Responsive: Design templates that work on mobile and desktop
- Accessible: Use semantic HTML and proper alt text for images
- Flexible: Design templates that work with varying product data
Troubleshooting
No Products Displaying
Possible Causes:- No products match your filter criteria
data-typeis too restrictive- Product codes in
data-codesdon’t exist - Products are inactive or unpublished
- Check your filter attributes
- Verify products exist in your system
- Try
data-type="any"to see all products - Check product status in your dashboard
Placeholders Not Replacing
Issue: Placeholders show as literal text (e.g.,{product.name})
Solutions:
- Check placeholder spelling (case-sensitive)
- Ensure you’re using
{product.*}format, not%product.*% - Verify the product field exists
Custom Attributes Empty
Issue:{product.attributes.*} is empty
Solutions:
- Verify the custom attribute is defined in product settings
- Check attribute name spelling (case-sensitive)
- Ensure the attribute has a value for that product
Related Documentation
- Collection Item Tag - Display collection entries
- Page Variables - Use variables and placeholders
- Buy Links - Add purchase links to products