In Wix Store, when you are in your Cart, there are two options for Coupons and Buyer Note.
Is there any way I can use a user input to add the note in the cart ?
Actually, user must click on the note to add it, and then user can write something in text.
I would like to use a user input element, (best would be selection tag, but even a text input would be fine) so my user can select a tag, and I add the result in my Buyer Note.
I can find in the wix-store-backend the function getCurrentCart :
import wixStoresBackend from 'wix-stores-backend'
export function getCurrentCart() {
return wixStoresBackend.getCurrentCart();
}
/* Returned promise resolves to:
*
* {
* "_id": "b36eb035-635a-450e-b74d-acf86ee4dfcc",
* "appliedCoupon": {
* "couponId": "e81e9c48-f954-4044-ba64-ccfe5c103c8f",
* "name": "Summer Sale",
* "code": "SummerSale",
* "discountValue": "$10.00",
* "couponType": "MoneyOff"
* },
* "billingAddress": {
* "firstName": "John",
* "lastName": "Doe",
* "email":"john.doe@somedomain.com",
* "phone":"5555555",
* "address":"235 West 23rd Street\nNew York, New York 10011\nUnited States"
* },
* "buyerNote": "This is a note from the buyer.",
Last line here is what I am looking for.
How can I access this “buyerNote” in wix code ?
Hope someone can help on this !
Thanks
Hey Oscar,
Not possible at the moment but Wix is working on others solutions so we’ll have more possibilities in the future
Thanks Quentin for your answer.
May I ask you if you have any idea how I could use a user input to “pass” an information to my order ?
If you think about restaurant pickup order.
I want my client to specify the specific time when they want to collect their order*.
I was thinking using selection tag and the answer to my first question, but if it can’t be done, I must find a workaround.
Again, thanks you for your time and take care
- I can’t use Wix Restaurant Order and must use Wix Store
You could create a collection “orderPickupTime” with 2 field: a reference to an order and a datetime field
On the checkout page hide the checkout element until they complet the pickup details in a custom form.
Once date and time is selected, display the checkout element and save the info in local storage
On the thanks you page retrieve the order from the thank your page element, the date & time from local storage and save it in orderPickupTime.
Super hacky and won’t work 100% (if the client close the thank you page before it execute the query, it won’t save)
So you’ll have to put some kind of fallback mechanism in case there is an order without date
Is the pickup free? Otherwise you could add a product “pickup” or package management to the cart instead (as low as 0.01$ ) and put the custom text as the delivery time instead of using a collection
Thanks for your time and your reply.
I also find this a bit to hacky.
First, if it fails and user don’t see it fails, the order will be prepared at a wrong moment. And if it fails with a strong fallback, user might end up bored of such a hard way to give such a simple information
Not to say an order without date is, by default, to be prepared right now for an “instant pickup”. So thats makes the fallback even harder to build.
I already though about the product trick and I may end up with this solution, if the test’s feedback reveals that the actual “built-in” solution for the “add note” by the buyer isn’t enought… I may find a way to connect just a button to the special “time products” so selection can really looks like selection tags…
Anyway, thanks a lot Quentin for your time and ideas !
Take care
Edit : after a bit of thinking, it seems wix won’t let us set a “Maximum amount” for a specific product. I don’t think “time product” is a good idea because 1/ it will add a product to the order (meaning you buy one salad you have two product in cart on checkout > strange) 2/people may end up adding multiple time same or different…
I will have to think more