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

Add documentation for setCustomData method #61

Open
polishq opened this issue Apr 16, 2020 · 2 comments
Open

Add documentation for setCustomData method #61

polishq opened this issue Apr 16, 2020 · 2 comments
Assignees

Comments

@polishq
Copy link

polishq commented Apr 16, 2020

Currently readers might assume that vtexjs.checkout.sendAttachment() can be used to set customData on the orderForm. Please update documentation to include a section on how to set custom data fields on an account and how to use setCustomData to fill the custom fields with data.

@LIZBETHJAICO
Copy link

entonces no se usa vtexjs.checkout.sendAttachment() para datos personalizados? . llegaste encontrar la solución podrías explicar cómo lo hiciste.

@cristiancustomsoft
Copy link

First you need to make a new app in your orderform configuration. To do that:

Make a GET request here: https://{{vendor}}.vtexcommercestable.com.br/api/checkout/pvt/configuration/orderForm

Copy the response and change the apps section. Add a new object there

"apps": [
	{
		"fields": [
			"YOUR_FIELD"
		],
		"id": "YOUR_APP"
	}
],

Make a PUT request on the same endpoint with your updated payload.

After that, you can add custom data using the next method from checkout js:

vtexjs.checkout.setCustomData({app: 'YOUR_APP', field: 'YOUR_FIELD', value: 'VALUE_HERE'});

Hope it helps :)

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

4 participants