Link image from collection to Custom text fields

Hi There,
In my store, We print images on the products our customers are buying. (Like Mugs, Notebooks, Pens, ETC…)
I Would like the user to be able to attach an image when adding a product to the cart
After research, What I found so far is that I can add an uploader to the product form, And the uploader will populate a collection that I have created. So far so good.

The next thing I would like to do, Is to set the value of a custom text field, As the path / URL of the file the user uploaded.

I Did find an Example of a notebook, But it was an overkill for me. I don’t need the masking option and the overlay text. All I need is an image that the user can upload, and the ref on the custom text field.
Also, The documentation for that example was unclear for me, A lot of missing information.

Your help will be apprichiated ,
Thanks,

If you are using Wix Stores you can do that with custom text fields through the CartIcon.
https://www.wix.com/corvid/reference/$w.CartIcon.html
https://www.wix.com/corvid/reference/$w.CartIcon.html#AddToCartCustomTextField

Hi, Thanks for the quick reply. So in order to use the addToCart function in need the ID parameter. Im having trouble setting up the getProduct() function.
My code is very simple:

$w.onReady(async function () {
let product = await $w('#productPage1').getProduct();
});

and I’m getting the following error on the logs:

TypeError: $w('#productPage1').getProduct is not a function. (In '$w('#productPage1').getProduct()', '$w('#productPage1').getProduct' is undefined)

Any ideas? My Product Page ID is definitely ‘#productPage1’.