> ## Documentation Index
> Fetch the complete documentation index at: https://docs.virtual.fit/llms.txt
> Use this file to discover all available pages before exploring further.

# Product recommendations

> Recommend related products for the fitting room, product pages, and carts.

virtual.fit can rank your prepared catalog from the products a shopper is viewing, trying on, or buying. The same recommendation system supports the fitting room and server-to-server API requests.

## Recommendation modes

| Intent              | Use it for                                                                                | Context                                              |
| ------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `similar`           | More shorts, dresses, or other alternatives to the current product                        | Exactly one product                                  |
| `complete_the_look` | The next compatible category for the hosted fitting room, or for a custom outfit builder  | One to five products                                 |
| `likely_purchases`  | Products the shopper is likely to buy next, including same- or cross-category suggestions | Current/selected products, the current cart, or both |

Both multi-item intents become more specific as you add context. For example, a suggestion based on a shirt and trousers can account for both items instead of averaging separate recommendation lists. `complete_the_look` suppresses categories already represented in the outfit. `likely_purchases` does not, so it can recommend another shirt as well as shoes or an accessory.

`complete_the_look` can return an empty result when no compatible category remains. Do not replace it with unrelated products.

## Where recommendations appear

### Shopify

The hosted Shopify fitting room uses `complete_the_look` automatically. The merchant does not need to implement its recommendation rows. Theme scripts can request recommendations for additional placements after the app embed loads:

```javascript theme={null}
const result = await window.VirtualFit.recommend({
  intent: 'complete_the_look',
  excludeProductIds: ['sold-out-belt']
});
```

### Custom JavaScript

The hosted fitting room uses `complete_the_look` automatically with the current product and products already selected in the outfit. Keep those products up to date through the Custom JavaScript integration. Custom placements can call the browser API directly, including with explicit cart or product context.

### Your backend

Use the [recommendations API](/recommendations/api) for product-page alternatives, complete-the-look rows, cart cross-sells, and other server-rendered experiences. Use `likely_purchases` for general “You may also like” and cart recommendation placements.

## Keep recommendations current

Recommendations use only products that are enabled and prepared in virtual.fit. Sync new and changed products under the same stable product ID. You do not need to republish the rest of your catalog.

Use clear product images and accurate titles. Prefer full-product front, back,
and side views on a model or mannequin; they provide stronger visual and fit
context than flat-lay or isolated ghost images. Flat-lay and product-only
images remain useful when a styled photo contains a complete outfit.
virtual.fit analyzes and selects the strongest views automatically, so you do
not need to create special crops or remove backgrounds.

Products outside apparel and accessories are excluded. Accessories such as shoes, bags, and jewellery can still be recommended even when virtual try-on does not support them.

## Improve relevance with commerce events

For Custom JavaScript storefronts, send cart and purchase line-item events with the same product IDs used by your catalog. These events can improve recommendations over time.

The hosted fitting room automatically includes the current product and selected outfit items. Shopify also includes the current cart. For a Custom JavaScript storefront, pass the latest full cart as `cartProductIds`. Cart products influence both multi-item intents and are excluded from results, but only selected outfit products occupy `complete_the_look` categories.

[Review the commerce event reference →](/custom-js/commerce-events)

<Note>
  New products can be recommended before they accumulate commerce history.
</Note>
