Documentation
Feedback
Guides
API Reference

Guides
UI Customization
vtex.js
vtex.js for Catalog

The Catalog module gets data related to the products of the store.

getProductWithVariations(productId)

See below an example of the resulting object.

Returns

Promise for product details

Arguments

NameType
productIdString or Number The product ID. (It’s not the SKU!)

Example


_10
vtexjs.catalog.getProductWithVariations(1000).done(function(product){
_10
console.log(product);
_10
});

getCurrentProductWithVariations

Similar to getProductWithVariations, but automatically detects the productId.

Should be called exclusively on a product page.

Returns

Promise for product details

Example

Call


_10
vtexjs.catalog.getCurrentProductWithVariations().done(function(product){
_10
console.log(product);
_10
});

Resulting object


_65
{
_65
"productId": 4741,
_65
"name": "Ração Club Performance Junior Royal Canin",
_65
"salesChannel": "1",
_65
"available": true,
_65
"displayMode": "especificacao",
_65
"dimensions": ["Embalagem"],
_65
"dimensionsInputType": {
_65
"Embalagem": "Combo"
_65
},
_65
"dimensionsMap": {
_65
"Embalagem": ["3 kg", "15 kg"]
_65
},
_65
"skus": [{
_65
"sku": 2482,
_65
"skuname": "Ração Club Performance Junior Royal Canin - 15 kg",
_65
"dimensions": {
_65
"Embalagem": "15 kg"
_65
},
_65
"available": true,
_65
"listPriceFormated": "R$ 0,00",
_65
"listPrice": 0,
_65
"bestPriceFormated": "R$ 104,90",
_65
"bestPrice": 10490,
_65
"installments": 3,
_65
"installmentsValue": 3496,
_65
"installmentsInsterestRate": 0,
_65
"image": "http://www.exemplo.com.br/arquivos/ids/185213-446-446/Racao-Club-Performance-Junior---Royal-Canin.jpg",
_65
"sellerId": "1",
_65
"seller": "exemplo",
_65
"measures": {
_65
"cubicweight": 7.0313,
_65
"height": 10.0000,
_65
"length": 75.0000,
_65
"weight": 15300.0000,
_65
"width": 45.0000
_65
},
_65
"rewardValue": 840
_65
}, {
_65
"sku": 2483,
_65
"skuname": "Ração Club Performance Junior Royal Canin - 3 kg",
_65
"dimensions": {
_65
"Embalagem": "3 kg"
_65
},
_65
"available": true,
_65
"listPriceFormated": "R$ 0,00",
_65
"listPrice": 0,
_65
"bestPriceFormated": "R$ 39,80",
_65
"bestPrice": 3980,
_65
"installments": 1,
_65
"installmentsValue": 3980,
_65
"installmentsInsterestRate": 0,
_65
"image": "http://www.exemplo.com.br/arquivos/ids/185213-446-446/Racao-Club-Performance-Junior---Royal-Canin.jpg",
_65
"sellerId": "1",
_65
"seller": "exemplo",
_65
"measures": {
_65
"cubicweight": 1.8750,
_65
"height": 8.0000,
_65
"length": 45.0000,
_65
"weight": 3000.0000,
_65
"width": 25.0000
_65
},
_65
"rewardValue": 319
_65
}]
_65
}

Contributors
1
Photo of the contributor
+ 1 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
1
Photo of the contributor
+ 1 contributors
On this page