Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
Deprecated
Shelf
Official extension
Version: 1.49.0
Latest version: 1.49.0

With the goal of displaying a flexible product list, the shelf and shelf.relatedProducts blocks are deprecated and now configured using the Product Summary List, the Product Summary Shelf, and the Slider Layout blocks. To learn how to configure it, please refer to Building a Shelf.

The Shelf app displays a list of products on your store pages, helping you build your shop window and work on your visual merchandising.

{"base64":"  ","img":{"width":2852,"height":1266,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":601365,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-shelf-0.png"}}

Configuration

  1. Add the shelf app to your theme dependencies in the manifest.json file:

_10
"dependencies": {
_10
"vtex.shelf": "1.x",
_10
}

Now, you can use all the blocks exported by the shelf app. See the full list below:

Block nameDescription
shelf
{"base64":"  ","img":{"width":73,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","url":"https://img.shields.io/badge/-Deprecated-red"}}
Renders a list of products in the store home page.
shelf.relatedProducts
{"base64":"  ","img":{"width":73,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","url":"https://img.shields.io/badge/-Deprecated-red"}}
Renders a list of related products in the product details page.
  1. Declare the shelf.relatedProduct in the product template (store.product) using its props. For example:

_10
{
_10
"store.product": {
_10
"children": [
_10
"breadcrumb",
_10
"flex-layout.row#main",
_10
"shelf.relatedProducts"
_10
]
_10
}
_10
}

Warning

Note that for hiding unavailable/out-of-stock items, there are 2 different props: hideUnavailableItems and hideOutOfStockItems. They do the same thing, but each is used by a different component: Shelf and RelatedProducts, respectively.

Shelf

Prop nameTypeDescriptionDefault value
categoryStringThe category ID
collectionStringThe collection ID
orderByEnumOrderByTopSaleDESC, OrderByPriceDESC, OrderByPriceASC, OrderByNameASC, OrderByNameDESC, OrderByReleaseDateDESC, OrderByBestDiscountDESC
hideUnavailableItemsBooleanWhether out of stock items should be hidden (true) or not (false)false
paginationDotsVisibilityEnumvisible, hidden, mobileOnly, desktopOnly
productListProductListSchemaProduct list schema. See ProductListSchema-
trackingIdStringName to show in the Google Analytics. If nothing is passed it will use the name of the block instead
maxItemsNumberMax items

RelatedProducts

Prop nameTypeDescriptionDefault value
recommendationenumType of recommendations that will be displayed on the shelf. Possible values: similars, suggestions, and accessories (these depend on the product information given in the Admin Catalog); and view, buy, and viewandBought (these are automatically generated according to the activity of the store).similars
groupByenumDefines if you are ot nog going to group your recommendations by: PRODUCT (only display individual products and not SKUs, limited by 12 products) or NONE (if you want to display all registered SKUs, limited by 50 products).PRODUCT
hideOutOfStockItemsbooleanWhether out of stock items should be hidden: (true) or (false).false
productListProductListSchemaProduct list schema. See ProductListSchema.-

ProductListSchema:

Prop nameTypeDescriptionDefault value
maxItemsnumberMaximum number of items to be displayed on the related product shelf.10
scrollenumSlide transition scroll type. Possible values: BY_PAGE, and ONE_BY_ONE.BY_PAGE
arrowsbooleanWhether the arrows should be displayed on the shelf (true) or not (false).true
showTitlebooleanWhether a title should be displayed on the product-related shelf (true) or not (false).true
titleTextstringRelated product shelf title.null
gapenumSpace between items being displayed. Possible values are: ph0, ph3,ph5, and ph7.ph3
minItemsPerPagenumberMinimum number of items per shelf slides. This prop defines how many items will be displayed on the related product shelf, even in the smallest screen size. Its value can be a float, which means that you can choose a multiple of 0.5 to indicate that you want to show a peek of the next slide on the shelf.1
itemsPerPagenumberMaximum number of items per shelf slides. This prop defines how many items will be displayed on the related product shelf, even in the largest screen size. Its value can be a float, which means that you can choose a multiple of 0.5 to indicate that you want to show a peek of the next slide on the shelf.5
summaryobjectSchema declaring the desired related product shelf items. This prop object must contain the product-summary.shelf block props.undefined
' infinitebooleanDetermines whether the list should be infinite (true) or not (false). When this prop is set as false, the slider will have an explicit end for users.true

Customization

To apply CSS customizations to this and other blocks, follow the instructions in Using CSS Handles for store customization.

CSS Handles
relatedProducts

The CSS Handles list above refers to the shelf.relatedProducts block. Since the shelf block is deprecated, your shelf customization must be done using the CSS Handles available for the Product Summary List, the Product Summary Shelf, and the Slider Layout blocks.

See also
VTEX App Store
VTEX IO Apps