How to create dynamic attribute
Marketplaces want fields your catalog does not have. Google wants an availability of in stock or out of stock; your store has a quantity. An affiliate network wants a shipping band derived from weight. A channel wants "Adult" where you store a boolean.
A dynamic attribute computes that value from conditions you define, in the feed, without adding anything to your catalog. Define it once and use it in as many feeds as you like.
Create a new dynamic attribute
1. Navigate to the Dynamic attributes section
- Go to Catalog -> Advanced Product Feeds -> Dynamic attributes.
- Click Add New Attribute.
2. Configure the Dynamic attribute
2.1 Basic information
- Enter a name for the dynamic attribute in the Name field.
- Set a unique identifier (used in templates) in the Code field.
2.2 Set conditions
- Click Add "OR" Condition if any condition is met, the attribute applies.
- Click Add "AND" Condition all conditions must be met for the attribute to apply.
- Choose the attribute to evaluate in the Select Attribute field.
- Define the rule (e.g., "greater than," "contains," etc.) in the Select condition.
- Specify the value that triggers the condition in Enter value field.
2.3 Set output
-
Select output type to choose how the attribute is returned.
-
Define output either select an existing attribute or enter a custom value.
NoteIf no conditions are set, the dynamic attribute will return a default value.
3. Save the attribute
- Click Save to store the new dynamic attribute.
Example for dynamic attribute
Additional stock status
Configuration
- Name: Additional stock status
- Code:
stock_status - Condition: if stock quantity is greater than 0, return "In Stock"; otherwise, return "Out of Stock".
Usage in feeds
- XML template:
{{ product.dynamic:stock_status }} - CSV template: select the dynamic attribute from the dropdown.