Compare Products
You are reading an outdated document
Get the latest developer guides on Fynd Partners Help
The product comparison page will list products to compare. User can add products of their choice for comparison from the list.
Arguments
Context | Type | Description |
---|---|---|
title | String | Title of the product |
subtitle | String | Subtitle of the product. Can be descriptive |
items | Object | Object containing all details of the product. |
context.product
This will be an object with all details regarding two similar product for comparison, Refer this for sample response for a product. You can use this data to render the UI as required.
Example:
The below example will render a sample compare product card.
// Product Comparison Example
<div class="product-comparison" v-if="context && context.compared_products">
<h1>{{context.similars.title}}</h1>
<p>Description: {{context.similars.subtitle}}</p>
<ul v-for="compare in context.items">
<li>
<div>
Name: {{compare.name}}
Type: {{compare.type}}
</div>
<img src="compare.logo.url" />
</li>
</ul>
</div>