A simple library to generate XML of products for use in Zoom.
npm install zoom-products-xml
import { Builder } from "zoom-products-xml";
const builder = new Builder();
builder
.withProduct({
id: "100050",
name: "Camisa Carolina Rio Dream – Amarelo",
description:
"Regata feminina, modelo Carolina, na cor amarela, confeccionada em algodĂŁo e da marca Dream, maior varejo feminino do Brasil. Com estampa Rio Eu Te amo.",
listingPrice: 80,
price: 70.9,
installmentMonths: 4,
installmentAmount: 20,
link: "http://www.loja.com.br/produtoid=100050",
imagesLinks: [
"http://www.loja.com.br/img1",
"http://www.loja.com.br/img2",
"http://www.loja.com.br/img3",
"http://www.loja.com.br/img4",
],
department: "Camisa",
subDepartment: "Roupa Feminina",
brand: "Dream",
color: "Amarelo",
size: "M",
gender: "Feminino",
ean: "3452352356378",
sku: "fsdagrdgy636378",
})
.withProduct({
id: "100006154",
name: "Computador PC SpaceBR Dual Core Atom",
description:
"Computador PC SpaceBR, Intel® Dual Core Atom 1GB HD 320GB, DVD-RW, Windows 7 + Monitor LCD 21,5 LG Full HD Widescreen - W2243C-PF",
listingPrice: 1198,
price: 1198,
installmentMonths: 12,
installmentAmount: 99.83,
link: "http://www.loja.com.br/produtoid=100006154",
imagesLinks: ["http://www.loja.com.br/imgprodutoid=100006154"],
department: "Informática",
subDepartment: "Computadores",
mpc: "312412",
ean: "3452352356364",
sku: "fsdagrdgy636344",
})
.withProduct({
id: "100006155",
name: "Quem mexeu no meu sanduĂche",
description: "O grande sucesso de vendas",
listingPrice: 18,
price: 15,
installmentMonths: 1,
installmentAmount: 15,
link: "http://www.loja.com.br/produtoid=100006155",
imagesLinks: ["http://www.loja.com.br/imgprodutoid=100006155"],
department: "Livros",
subDepartment: "Autoajuda",
isbn: "5235346",
publisher: "Martins Fontes",
author: "Fulano de Tal",
mpc: "312416",
ean: "0234235235633",
sku: "fsdagrdgy21116344",
});
const xml = builder.buildXml();
console.log(xml);
XML generated by the code above:
<?xml version="1.0" encoding="utf-8"?>
<PRODUTOS>
<PRODUTO>
<CODIGO>100050</CODIGO>
<NOME>Camisa Carolina Rio Dream – Amarelo</NOME>
<DESCRICAO>Regata feminina, modelo Carolina, na cor amarela, confeccionada em algodĂŁo e da marca
Dream, maior varejo feminino do Brasil. Com estampa Rio Eu Te amo.</DESCRICAO>
<PRECO_DE>80,00</PRECO_DE>
<PRECO>70,90</PRECO>
<NPARCELA>4</NPARCELA>
<VPARCELA>20,00</VPARCELA>
<URL>http://www.loja.com.br/produtoid=100050</URL>
<URL_IMAGEM_1>http://www.loja.com.br/img1</URL_IMAGEM_1>
<URL_IMAGEM_2>http://www.loja.com.br/img2</URL_IMAGEM_2>
<URL_IMAGEM_3>http://www.loja.com.br/img3</URL_IMAGEM_3>
<URL_IMAGEM_4>http://www.loja.com.br/img4</URL_IMAGEM_4>
<DEPARTAMENTO>Camisa</DEPARTAMENTO>
<SUBDEPARTAMENTO>Roupa Feminina</SUBDEPARTAMENTO>
<MARCA>Dream</MARCA>
<GENERO>Feminino</GENERO>
<TAMANHO>M</TAMANHO>
<COR>Amarelo</COR>
<EAN>3452352356378</EAN>
<SKU>fsdagrdgy636378</SKU>
</PRODUTO>
<PRODUTO>
<CODIGO>100006154</CODIGO>
<NOME>Computador PC SpaceBR Dual Core Atom</NOME>
<DESCRICAO>Computador PC SpaceBR, Intel® Dual Core Atom 1GB HD 320GB, DVD-RW, Windows 7 +
Monitor LCD 21,5 LG Full HD Widescreen - W2243C-PF</DESCRICAO>
<PRECO_DE>1198,00</PRECO_DE>
<PRECO>1198,00</PRECO>
<NPARCELA>12</NPARCELA>
<VPARCELA>99,83</VPARCELA>
<URL>http://www.loja.com.br/produtoid=100006154</URL>
<URL_IMAGEM>http://www.loja.com.br/imgprodutoid=100006154</URL_IMAGEM>
<DEPARTAMENTO>Informática</DEPARTAMENTO>
<SUBDEPARTAMENTO>Computadores</SUBDEPARTAMENTO>
<MPC>312412</MPC>
<EAN>3452352356364</EAN>
<SKU>fsdagrdgy636344</SKU>
</PRODUTO>
<PRODUTO>
<CODIGO>100006155</CODIGO>
<NOME>Quem mexeu no meu sanduĂche</NOME>
<DESCRICAO>O grande sucesso de vendas</DESCRICAO>
<PRECO_DE>18,00</PRECO_DE>
<PRECO>15,00</PRECO>
<NPARCELA>1</NPARCELA>
<VPARCELA>15,00</VPARCELA>
<URL>http://www.loja.com.br/produtoid=100006155</URL>
<URL_IMAGEM>http://www.loja.com.br/imgprodutoid=100006155</URL_IMAGEM>
<DEPARTAMENTO>Livros</DEPARTAMENTO>
<SUBDEPARTAMENTO>Autoajuda</SUBDEPARTAMENTO>
<AUTOR>Fulano de Tal</AUTOR>
<ISBN>5235346</ISBN>
<EDITORA>Martins Fontes</EDITORA>
<MPC>312416</MPC>
<EAN>0234235235633</EAN>
<SKU>fsdagrdgy21116344</SKU>
</PRODUTO>
</PRODUTOS>