diff --git a/checkout/src/arquivos/js/components/Footer.js b/checkout/src/arquivos/js/components/Footer.js index ddbfee7..a026ccc 100644 --- a/checkout/src/arquivos/js/components/Footer.js +++ b/checkout/src/arquivos/js/components/Footer.js @@ -8,6 +8,9 @@ export default class Footer { async init() { await this.selectors(); // this.onUpdate(); + await this.pegarInfo( + "https://m3academy.myvtex.com/api/catalog_system/pub/products/search/?fq=productClusterIds:319" + ); } async selectors() { @@ -37,4 +40,19 @@ export default class Footer { slidesToScroll: 1, }); } + produto(data) { + return { + imagem: data["items"][0]["images"][0]["imageUrl"], + nome: data["productName"], + tamanho: data["items"].map((val) => val["name"]), + }; + } + async pegarInfo(url, tratamento) { + const response = await fetch(url); + //console.log(response); + const data = await response.json(); + //console.log(data); + const Items = data.map((val) => this.produto(val)); + console.log(Items); + } }