Margin Awareness lets you define and use profit in a way that fits your business, from simple calculations to more advanced logic using custom fields or templates.
Profit and margin are stored on each product and stay up to date as your data changes. You can use this data across your store to promote higher-profit products in search, prioritize them in merchandising tools like Vexture, build collections based on profitability, and make smarter pricing and promotion decisions with AI Insights.
How Margin is Calculated
Margin Awareness calculates two key values:
Profit = Price – Cost (or your custom formula)
Margin (%) = (Profit ÷ Price) × 100
How to Configure Margin Awareness
Go to Catalog → Margin.
1. Select how profit should be calculated
The fields required depend on the calculation method you choose. For example, Price minus Cost requires both Price and Cost, while other methods can use custom fields or template logic.
Price Minus Cost
Uses the product’s Price and Cost fields.Price Minus Custom Field
Subtracts a selected custom field value from the product price.Custom Field
Uses a custom field value directly as profit.Template (Advanced)
Uses custom template logic to define profit and margin.
Template Example
The following template replicates the default “Price Minus Cost” calculation:
<mvt:assign name="l.settings:product:profit" value="l.settings:product:price - l.settings:product:cost" />
<mvt:if expr="l.settings:product:price EQ 0">
<mvt:assign name="l.settings:product:margin" value="0.0" />
<mvt:else>
<mvt:assign name="l.settings:product:margin" value="( ( l.settings:product:profit / l.settings:product:price ) * 100 ) ROUND 2" />
</mvt:if>
When using the template method:
Assigning a value to
product:profitsets the product’s profitAssigning a value to
product:marginsets the product’s margin
2. Configure Search Relevance (Optional)
Margin Awareness can influence search results.
1. Relevance
None (default)
Profit
Margin
2. Relevance Count
Defines how many top results are reordered based on profit or margin.
Example:
Relevance = Profit, Count = 24
→ Top 24 search results are reordered by highest profit
Relevance = Margin, Count = 10
→ Top 10 results are reordered by highest margin
This allows you to promote more profitable products without completely overriding search relevance.
Keeping Margin Data Updated
Margin and profit update automatically when product data (like price or cost) changes.
Manually recalculate margins when:
After changing margin calculation settings
After updating a template
To do this, either click Recalculate Profit Margin button on the right corner of the Margin tab
or Run the Recalculate Product Profit and Margin scheduled task
Viewing Profit and Margin Data
You can view profit and margin data within the Catalog Batch List:
Catalog Batch List
Add the Profit and Margin columns for comparison across products
Using Margin Across Your Store
Once calculated, margin data can be used to:
Promote higher-margin products in search results
Prioritize products in Vexture Merchandising
Build collections based on profitability
Filter and sort products by profit or margin
Note: Margin-based relevance only applies to products included in search. Products marked Exclude from Search Results will not appear, regardless of their profit or margin. For more information, see the Creating a New Product documentation.