Store Product Custom Text Fields

Hey,

I have a product page made with code and would like to be able to add Custom text to the product.
I enabled the custom text for the product


I now want when adding to cart to add the text
I tried the following code:
itemsToAdd.push({ productID: service._id, quantity: 1, StoreProductCustomTextFields: CustomText });
But no go. )-:

I guess that the “custom text field” name (what I named ‘Info’) should be included as well in the string, but have no idea where to add it.

Any thoughts on this?

#wix_stores, #productPage

1 Like

Have a read of Wix Support’s own pages about Wix Stores.
https://support.wix.com/en/wix-stores/setting-up-your-store
https://support.wix.com/en/article/adding-a-customer-message-box-to-your-wix-stores-product-page

Thanks for this, but
This is all done.
As I have a Product page built with code I collect the text into an array (named CustomText).
My question is how via code I can insert the data to this field in the order

You can find your customer’s message in your Orders tab and in the notification email that you receive once the order is placed.

Also, have a a read about the collection fields for Products.
https://support.wix.com/en/article/corvid-wix-stores-product-collection-fields#customtextfields-customtextfields-1

@givemeawhisky Thanks again.
I do not understand from the documentation if I can push information to custom text field using code.
If yes, I would appreciate the code.

Thanks,

I think i am looking for a solution for the same problem. Due to the product option limitations (primarily NOT being able to select multiple values i.e Red, Blue, Green, Yellow)…
For that matter I created values to select how many items they want to find. Then I created a Custom Text Field so the user has to manually type and define the options. (i.e if they buy 3 of the same item then they type in the options Red, Blue, Yellow) (it’s pretty primitive but I am burned out on looking for a code solution for this.)
Now I want to customize the product page so I can make all this clearer and cleaner with my design. However, the custom product page dataset is Read only" and doesn’t allow connecting an input field to the customTextField field in the store database.
Please someone advice.

Hi GOS, I would appreciate if you could provide me the way to parse value into customTextField. I know that the add to cart button in shop element allow user to key-in message before they checked out. Kindly refer to screenshots below.

Add To Cart button Pop-Up from shop element which only linked to 1 product at a time.

I would like to know how to call the customTextField value , so I can parse string value into the customTextField without using the Add To Cart button from shop element.

By using console.log I was able to extract the following but without a trace of value :

customTextFields: Array(1) []
0: {...} {}
title: "SpecialRequestTitle"
maxLength: 500
mandatory: true

Code:

let customerRequest;
$w('#inputCustRequest').text = customerRequest;

selectedFruits.forEach(function(fruit){
fruitsToAdd.push({ productID: fruit._id, quantity: 1, options:{}, customTextFields:customerRequest });
console.info(gift);
});

Output:

FetchError: {"code":"CANNOT_ADD_CART","commandName":"AddToCart","message":"Product with id 7cg34a7b-60b2-9nf3-eo80-123456783325 requires a value for SpecialRequestTitle input field","field":""}