Integration Fields
Integration Fields allow you to use Magento product and category data directly in your Prismic documents. This creates a dynamic connection between your Magento catalog and Prismic content.
Configuration
Basic Setup
- Go to Stores > Configuration > Elgentos > Prismic.IO
- Navigate to Integration Fields section
- Configure:
- Product Attributes to sync
- Product Visibility settings
- Access Token for security
- Disabled Products sync option
Default Product Attributes
The following attributes are always available: - name - image - status - short_description - updated_at
Setting Up in Prismic
Creating Integration Fields
- Go to your Prismic dashboard
- Navigate to Settings > Integration fields
- Create a new Custom Integration
- Configure the endpoints:
- Products:
https://your-store.com/prismicio/integration/products
- Categories:
https://your-store.com/prismicio/integration/categories
- Add the Access Token if configured in Magento
Adding to Content Types
{
"Main": {
"featured_product": {
"type": "IntegrationFields",
"config": {
"catalog": "product_catalog",
"label": "Featured Product"
}
}
}
}
Available Endpoints
Products Endpoint
Returns product data in Prismic-compatible format:
{
"results_size": 100,
"results": [
{
"id": "123",
"title": "Product Name",
"description": "Short description",
"image_url": "https://example.com/media/catalog/product/image.jpg",
"last_update": 1673891234,
"blob": {
// All selected product attributes
}
}
]
}
Categories Endpoint
Returns category data:
{
"results_size": 50,
"results": [
{
"id": "4",
"title": "Category Name",
"description": "Category description",
"image_url": "https://example.com/media/catalog/category/image.jpg",
"last_update": 1673891234,
"blob": {
// All category attributes
}
}
]
}
Security
Access Token Protection
-
Configure an access token in Magento:
-
Use the same token in Prismic's Integration Fields setup
Authentication Headers
The endpoints use Basic Authentication: - Username: Your access token - Password: Can be left empty
Configuration Options
Product Sync Options
-
Visibility Settings
-
Disabled Products
-
Custom Attributes
Implementation Examples
Basic Product Integration
{
"Main": {
"related_products": {
"type": "Group",
"config": {
"fields": {
"product": {
"type": "IntegrationFields",
"config": {
"catalog": "product_catalog"
}
}
}
}
}
}
}
Category Selection
{
"Main": {
"featured_category": {
"type": "IntegrationFields",
"config": {
"catalog": "category_catalog"
}
}
}
}
Best Practices
- Performance
- Limit the number of attributes synced
- Use pagination for large catalogs
-
Consider caching strategies
-
Security
- Always use access tokens in production
- Limit exposed attributes to necessary data
-
Regularly rotate access tokens
-
Data Management
- Sync only required product visibility types
- Consider impact of disabled products
-
Keep attribute selection minimal
-
Maintenance
- Monitor API response times
- Review and update synced attributes
- Check for outdated product references
Troubleshooting
- Authentication Issues
- Verify access token configuration
- Check authentication headers
-
Confirm Prismic integration setup
-
Missing Data
- Check product visibility settings
- Verify attribute configuration
-
Confirm product/category status
-
Performance Problems
- Review number of synced attributes
- Check pagination settings
- Monitor API response times