Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Recommendation Shelf
Official extension
Version: 2.12.0
Latest version: 2.12.0

This app is currently under development and research by the VTEX Search and Personalization team. During this phase, it should only be installed on selected accounts participating in the closed beta phase of the Product Recommendations feature. For other accounts, installing this app will not have any effect. If you want to adopt this feature for your business, please contact our Support.

The Recommendation Shelf app is a store component that displays a collection of products using recommendation strategies.

{"base64":"  ","img":{"width":3170,"height":1406,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":1264326,"url":"https://cdn.jsdelivr.net/gh/vtex-apps/recommendation-shelf@master/docs/shelf.png"}}

Learn more about Product Recommendations.

Before you begin

Most recommendation strategies rely on user navigation data as input. Therefore, your store must be configured with our pixel for the recommendation-shelf to work properly. This configuration is managed by the VTEX team, so please wait for our confirmation before proceeding with the integration.

Installation

This app uses our store builder with the blocks architecture. To learn more about Store Builder, click here.

Follow these steps to use the Recommendation Shelf app in your store:

  1. Add the app as a dependency in your store theme. In your manifest.json file, add the following to the dependencies section:


    _10
    "dependencies": {
    _10
    "vtex.recommendation-shelf": "2.x"
    _10
    }

  2. Add the recommendation-shelf block into your app theme where you want the shelf to appear.

  3. Customize the behavior of the shelf block.

    The example below shows the following configuration of the recommendation-shelf block and its supporting blocks:

    • It creates a recommendation-shelf#visual-similarity block that uses the "VISUAL_SIMILARITY" recommendation strategy and sets the shelf title to "Similar items".
    • It defines a list-context.product-list-static block, which includes the product-summary.shelf block and a child slider layout.
    • It configures the slider-layout#recommendation-slider block to control how many items are shown per page on desktop, tablet, and phone, and enables infinite scrolling.

    Example:


    _25
    "recommendation-shelf#visual-similarity": {
    _25
    "blocks": ["list-context.product-list-static"],
    _25
    "props": {
    _25
    "campaignVrn": "vrn:recommendations:biggy:rec-similar-v2:00318b68-cb1b-4d5a-8b0f-cc7fbcdd014b",
    _25
    "title": "Similar items"
    _25
    }
    _25
    },
    _25
    "list-context.product-list-static": {
    _25
    "blocks": [
    _25
    "product-summary.shelf"
    _25
    ],
    _25
    "children": [
    _25
    "slider-layout#recommendation-slider"
    _25
    ]
    _25
    },
    _25
    "slider-layout#recommendation-slider": {
    _25
    "props": {
    _25
    "itemsPerPage": {
    _25
    "desktop": 5,
    _25
    "tablet": 3,
    _25
    "phone": 2
    _25
    },
    _25
    "infinite": true
    _25
    }
    _25
    }

  4. Customize the product summary (optional).

    The Recommendation Shelf relies on the slider-layout and product-summary.shelf components. You can further customize the shelf by creating a custom product summary, for example:


    _10
    "product-summary.shelf#custom": {
    _10
    "children": [
    _10
    "product-summary-name",
    _10
    "product-summary-description",
    _10
    "product-summary-image",
    _10
    "product-summary-price",
    _10
    "product-summary-sku-selector",
    _10
    "product-summary-buy-button"
    _10
    ]
    _10
    }

    For more information, see the Product Summary API configuration.

Configuration

You can configure the recommendation-shelf block in your theme app using the following props:

Props

Configure the recommendation-shelf block using the following properties:

Prop nameTypeDescriptionDefault value
titlestringShelf title displayed to users.-
campaignVrnstringVRN identifier for the recommendation campaign.-
displayTitlebooleanWhether to show the shelf title (true) or hide it (false).true
itemsContextarrayContext source for items in the recommendation request (PDP or CART). Useful for enabling shelves on the cart page with CROSS_SELL.['PDP']

Recommendation strategies

Below are the available recommendation strategies that can be used to fetch product suggestions:

strategyDescriptionPages
TOP_ITEMSReturns the most bought products in the store.Any
PERSONALIZEDReturns recommended products based on the last products clicked by the user in the store.Any
LAST_SEENReturns recommended products based on the last products viewed by the user in the store.Any
CROSS_SELLReturns complementary products related to the current product or the items in the cart.Any
VISUAL_SIMILARITYReturns products considered visually similar to the current product.store.product
SIMILAR_ITEMSReturns products considered most similar to the current product.store.product

Troubleshooting

Check if others have encountered similar issues here. Feel free to open issues or contribute with pull requests.

{"base64":"  ","img":{"width":110,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","url":"https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square"}}

See also
VTEX App Store
VTEX IO Apps