Documentation
Feedback
Guides
VTEX IO Apps

VTEX IO Apps
VTEX Product Details
Official extension
Version: 1.22.0
Latest version: 1.22.0

{"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"}}

Description

The VTEX Category Menu app shows the details of a product like image, name and price. THis app is used by store theme.

:loudspeaker: Disclaimer: Don't fork this project. Use, contribute, or open issue with your feature request.

Release schedule

ReleaseStatusInitial ReleaseMaintenance LTS StartEnd-of-lifeDreamstore Compatibility
[1.x]Current Release2018-11-282.x
[0.x]Maintenance LTS2018-05-292018-11-28March 20191.x

See our LTS policy for more information.

Table of Contents

Usage

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

We add the product-details as a block in our Store Header.

To configure or customize this app, you need to import it in your dependencies in manifest.json.


_10
dependencies: {
_10
"vtex.product-details": "1.x"
_10
}

Then, add product-details block into your app theme, like we do in our Store theme app.

Now, you can change the behavior of the product-details block that is in the store header. See an example of how to configure:


_37
"product-details": {
_37
"blocks": [
_37
"breadcrumb",
_37
"product-name",
_37
"product-images",
_37
"product-price",
_37
"product-description",
_37
"product-specifications",
_37
"buy-button",
_37
"sku-selector",
_37
"shipping-simulator",
_37
"availability-subscriber",
_37
"share"
_37
],
_37
"props": {
_37
"displayVertically": true,
_37
"share": {
_37
"social": {
_37
"Facebook": true,
_37
"WhatsApp": true,
_37
"Twitter": false
_37
}
_37
},
_37
"price": {
_37
"labelSellingPrice": null,
_37
"showListPrice": true,
_37
"showLabels": true,
_37
"showInstallments": true,
_37
"showSavings": true
_37
},
_37
"name": {
_37
"showBrandName": false,
_37
"showSku": false,
_37
"showProductReference": false
_37
}
_37
}
_37
}

Blocks API

When implementing this app as a block, various inner blocks may be available. The following interface lists the available blocks within product-details and describes if they are required or optional.


_24
{
_24
"product-details": {
_24
"required": [
_24
"product-images",
_24
"product-name",
_24
"product-price",
_24
"sku-selector",
_24
"buy-button",
_24
"product-description",
_24
"product-specifications"
_24
],
_24
"allowed": [
_24
"breadcrumb",
_24
"shipping-simulator",
_24
"availability-subscriber",
_24
"share",
_24
"addon-details-btn"
_24
],
_24
"component": "ProductDetails"
_24
},
_24
"addon-details-btn": {
_24
"component": "*"
_24
}
_24
}

The ProductDetails has the required blocks: product-images, product-name, product-price, sku-selector, buy-button, product-description and product-specifications. So, any ProductDetails block implementation created must add these blocks.

Configuration

Through the Storefront you can change the behavior and interface of ProductDetails. But, you can also make adjusts in your theme app, like Store does.

Prop nameTypeDescriptionDefault Value
priceObjectConfigures the product price area (More info on the table bellow)false
nameObjectConfigures the product name area (More info on the table bellow)false
displayVerticallyBooleanWhether to display the preview images on the vertical or notfalse
showSpecificationsTabBooleanWhether to display the product specification on tab mode or notfalse

Price:

Prop nameTypeDescription
showListPriceBooleanShows the list prices
showLabelsBooleanShows the labels in the price and installments
showInstallmentsBooleanShows the installments information
showSavingsBooleanShows the savings information
labelSellingPriceStringText of the label before the price

Name:

Prop nameTypeDescription
showProductReferenceBooleanShows the product reference
showBrandNameBooleanShows the brand name of the product
showSkuBooleanShows the sku value for this product

Highlight:

Prop nameTypeDescription
defaultHighlightbooleanIndicates whether the group chosen as the highlight will contain all the properties in product or a group typed entry.
true
showHighlightsBooleanShows the highlights of the product
highlightGroup

Specification:

Prop nameTypeDescription
showSpecificationsbooleanShow the specifications of the product
specificationGroupsobjectDefine if will be displayed all the specifications of the product or a set of this specifications.
viewModestringDefine what is the current view mode for the specifications.
typeSpecificationsstringindicates which specifications will be displayed

Also, you can configure the share that is defined on ProductDetails. See here the Share API.

Styles API

This app provides some CSS classes as an API for style customization.

To use this CSS API, you must add the styles builder and create an app styling CSS file.

  1. Add the styles builder to your manifest.json:

_10
"builders": {
_10
"styles": "1.x"
_10
}

  1. Create a file called vtex.product-details.css inside the styles/css folder. Add your custom styles:

_10
.container {
_10
margin-top: 10px;
_10
}

CSS namespaces

Below, we describe the namespaces that is define in the ProductDetails.

Class nameDescriptionComponent Source
containerThe main container of Product DetailsproductDetails
nameContainerThe container of the name areaproductDetails
detailsContainerThe container of the details areaproductDetails
priceContainerThe container of the price areaproductDetails
informationsContainerThe container of the information areaproductDetails
fixedButtonThe product buy buttonFixedButton/index
highlightsContainerThe container of product highlights areaproductDetails

Troubleshooting

You can check if others are passing through similar issues here. Also feel free to open issues or contribute with pull requests.

Contributing

Check it out how to contribute with this project.

Tests

To execute our tests go to react/ folder and run yarn test

Travis CI

{"base64":"  ","img":{"width":98,"height":20,"type":"svg","mime":"image/svg+xml","wUnits":"px","hUnits":"px","length":730,"url":"https://api.travis-ci.com/vtex-apps/product-details.svg?branch=master"}}

See also
VTEX App Store
VTEX IO Apps