Connect text field to Custom Text field of a product

Hello,

I created a custom product page (you have to select “Etiquette personnalisée” to make the text field appear) with vélo and I struggle to connect a text field to the custom text field of a product with vélo.

The data is correctly retrieved (Cf. JSON bellow) but not added to the cart when the user click on the add to cart button (cf. Screenshot bellow).

JSON of the product added to cart :

{
  "productId": "beefc1d5-4355-41f8-9906-eddb91f54944",
  "quantity": 1,
  "options": {
    "choices": {
      "Choix de l'étiquette": "Étiquette personnalisée"
    }
  },
  "customTextFields": [
    {
      "title": "test"
    }
  ]
}

Here is the code that should handle this part :

const addTocart = () => {
        let products = [{
            "productId": productData._id,
            "quantity": Number(nombre),
            "options": {
                choices: choices
            },
            "customTextFields": customTextFields
        }, ];

Would you have any idea on the root cause of this problem ?

Product:
I’m using Velo with editor X

What are you trying to achieve:
Make the text filled on a text field be added as

Thanks a lot for your help !

Regards,
Remy

Is some code missing?

I don’t see where the addToCart() function is being called or where the productData and other variables in the products array are coming from.

Assuming this is the addProducts function and that customTextFields is being reused from your object the test field is missing a value which according to the docs should be defined as: