Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problema ao enviar shippingData #33

Open
mvianello opened this issue Dec 15, 2017 · 1 comment
Open

Problema ao enviar shippingData #33

mvianello opened this issue Dec 15, 2017 · 1 comment

Comments

@mvianello
Copy link

Estou com dificuldades para adicionar o address number e o address complement ao orderForm.shippingData, os valores até aparecem num console.log após atribuir os dois valores, mas depois de enviado, exibo o orderForm no console e não contem mais os dois valores..

@klzns
Copy link
Contributor

klzns commented Dec 15, 2017

@mvianello Para alterar os campos do endereço basta fazer algo como:

const address = orderForm.shippingData.address
const newAddress = {
  ...address,
  number: '123',
  complement: '456'
}
vtexjs.checkout.sendAttachment('shippingData', { address: newAddress })
  .then((orderForm) => {
    console.log(orderForm.shippingData.address)
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants