Frequently bought with
Keep track of which products are frequently bought together in your store. Use in your theme to drive upsells (”customers often pair this with ...”) or use it as an admin filter to find product bundle candidates.
This metafield is automatically updated via your shop's orders as they come in. When you initially enable the live metafields, the orders during the past 60 days are analyzed. Product pairings (regardless of the chosen variant) seen in at least 3 orders over the past 60 days qualify the pairings as being "frequently bought with" and the metafield's list of products is updated accordingly. Otherwise, the metafield is deleted.
Details
- Name
espresso.frequently_bought_with
- Description
Metafield namespace and key
- Name
list.product_reference
- Description
Metafield type
- Name
product
- Description
Scope of Shopify object that owns the metafield
When you initially enable this metafield, the individual product metafields will be set in a background task. If you have a large number of orders in the past 60 days, this may take anywhere from a few minutes to a few hours. Once the metafields are set, they will be updated in real-time
Example implementation
{% assign frequently_bought_products = product.metafields.espresso.frequently_bought_with.value %}
{% if frequently_bought_products.size > 0 %}
<div class="frequently-bought-products">
<h2>Frequently Bought With</h2>
<ul>
{% for product in frequently_bought_products %}
<li class="frequently-bought-item">
<a href="{{ product.url }}">
<img src="{{ product.featured_image | img_url: 'medium' }}" alt="{{ product.title }}" />
<h3>{{ product.title }}</h3>
<p>{{ product.price | money }}</p>
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}