top of page

Forum Posts

Shan
Velo Certified
Velo Certified
Mar 09, 2023
In Tips, Tutorials, Examples
Interested in drawing lines on a Google Map? Learn how to use the Routes API to calculate the fastest route between 2 locations Learn: https://youtu.be/lnx1n1ZM6Bc
Learn How To Use Google Maps Routes API On Wix content media
1
1
53
Shan
Velo Certified
Velo Certified
Mar 09, 2023
In Tips, Tutorials, Examples
Really cool feature to have on your contact form! Leave your customers puzzled to the instant customized reply :) Learn: https://www.youtube.com/watch?v=0kknb3jEweo
Send Triggered Emails On Wix Forms Submissions Using ChatGPT - OpenAI ChatGPT Tutorial content media
1
0
626
Shan
Velo Certified
Velo Certified
Feb 18, 2023
In Tips, Tutorials, Examples
Video: https://youtu.be/QpMh1S-2bEw So this is a very basic integration between OpenAI's language completion model and your very own Wix Chat to allow the davinci model to respond to customer queries via Wix Chat. Endless possibilities to automate customer support using this method. I'll let you be creative on how you enhance this.
Tutorial: Integrate OpenAI Davinci Completion Model With Wix Chat content media
1
0
74
Shan
Velo Certified
Velo Certified
Feb 17, 2023
In Tips, Tutorials, Examples
Video: https://youtu.be/TAZyBDTKHCI This video explains how to create a custom registration form using Wix Members API and then award users with 50 points for verifying their phone number. We used Twilio's sms verification service to verify users phone number and the new Wix Loyalty API (which is still in developer preview) You must install the Wix Loyalty Program App & a Wix Vertical like Wix Stores, Wix Bookings, etc in order for this example to work. Also make sure to activate your loyalty program using your Wix Site's dashboard. Notes: Use your live credentials from Twilio, sandbox credentials are not authorized to call the verify service Explained later on in the video, instead of Wix CRM's event we will depend on Wix Loyalty API's event to save the Loyalty ID in conjunction with the Contact ID. This is because once the Loyalty program is fully active the site automatically creates a Loyalty ID for the Contact so calling the createAccount() function will return an error For this example to work we are currently depending on the logic that Wix has, which is if a site member registers for the first time (with no prior interaction with the site before as far as giving out the email goes) then the Contact ID & Member ID are the same
Tutorial: Award 50 Loyalty Points To Registered Users For Phone Number Verification content media
1
1
31
Shan
Velo Certified
Velo Certified
Aug 08, 2022
In Coding with Velo
The documentation (https://www.wix.com/velo/reference/$w/uploadbutton/validity) says this regarding .validity So I do this & then I get this .validity.valid = false But I can upload the image just fine. Same thing with .valid
Bug with Upload Button .validity.valid & .valid content media
0
2
27
Shan
Velo Certified
Velo Certified
Jul 01, 2022
In Coding with Velo
There are critical queries in complex applications which absolutely require querying the master instead of the replica which might not contain the latest entries. Please think about providing a way to read directly from the master instead of depending on a timeout or timeout loop to wait for the replica to update with latest values. Timeout will not work when generating incremental IDs as well.
0
0
9
Shan
Velo Certified
Velo Certified
Jun 30, 2022
In Coding with Velo
We launched a custom checkout page recently using the Wix Stores createOrder() API and today one of the orders were not pushed through after payment (we handle payments, not Wix) due to this error message: ERROR MESSAGE 1 {"location":"BACKEND","source":"processOrder()","raw":{"stores_error":{"message":"deadline exceeded after 10000518599ns","details":{}},"reason":"WIX_API_FAILURE"}} Firstly this Wix Stores error message (in bold above) makes no sense to me as a developer, why did this happen? Second, we have a way to retry the order from the admin side when something like this happens (I did not trust the API so had a dashboard ready for this occasion) however when sent to the createOrder() API the API returns this message: ERROR MESSAGE 2 {"location":"BACKEND","source":"processOrder()", raw:{"err":{"message":"Insufficient inventory for orderId[Some(693d3ca5-048b-4ce0-8629-aba7fbcc7436)]","details":{}},"reason":"WIX_API_FAILURE_ON_RETRY_FROM_ADMIN"}} Now we are receiving this error message but here's the fun part, this time the order is going through and being created however the API is returning an error message. The function which threw "ERROR MESSAGE 1" above is: return wixStoresBackend.createOrder(order.orderObject) .then( (new_order) => { let order_id = new_order.number; if(stripe_response.id !== 'FREE_ORDER') { updateStripe(stripe_response.id, order_id, payment_version); } updateDb(stripe_response.id, order_id, order); return {status: 200, api: stripe_response, orderId: new_order._id}; }) .catch( (err) => { // Update order status in database with stripe charge id updateDbFailure(order, stripe_response.id); // Log error data on google operations console.log({ location: 'BACKEND', source: 'processOrder()', raw: { stores_error: err, reason: 'WIX_API_FAILURE' } }); return {status: 201, api: stripe_response}; }); The function which threw "ERROR MESSAGE 2" above is: return wixStoresBackend.createOrder(item.orderObject) .then( (new_order) => { let order_id = new_order.number; if(item.chargeId !== 'FREE_ORDER') { updateStripe(item.chargeId, order_id); } return updateDb(item, order_id); }) .catch( (err) => { // Log error data on google operations console.log({ location: 'BACKEND', source: 'processOrder()', raw: { item: item, err: err, reason: 'WIX_API_FAILURE_ON_RETRY_FROM_ADMIN' } }); return {status: 400, error: err}; }); The site's metaID is 9bf8fbe0-b44b-49ef-9643-9793242fde74 and code is called from the Wix Stores Cart page. This is a problem with the Wix Stores createOrder() API. How can the same order object be rejected 1 hour ago but then accepted with an error response later?
0
1
32
Shan
Velo Certified
Velo Certified
Sep 06, 2021
In Coding with Velo
I have an afterInsert() hook on Site A which makes a fetch call to Site B's endpoint. The endpoint on Site B inserts the received body into a collection. The issue is that both on Site A & Site B there is a "Date & Time" field type but the value is never inserted properly on Site B. It always prompts to "Convert" and if not manually converted the date appears weird on the live site (Screenshots below). Additional info: Site A is a normal Wix Site & Site B is Editor X
Date & Time Field Type Issue With Editor X content media
0
5
138
Shan
Velo Certified
Velo Certified
Jun 11, 2021
In Coding with Velo
Guys, Regarding Wix Chat Backend API's only event onMessage() The event's "direction" parameter states only two options: VisitorToBusiness BusinessToVisitor What about Member to Member message? The event is not fired in this case? I'm assuming its not available due to privacy reasons but just wanna confirm.
0
4
68
Shan
Velo Certified
Velo Certified
May 03, 2021
In Coding with Velo
Since Wix has released the new dataset Live Preview feature where items from the database are auto loaded whenever you connect a repeater to a dataset on the page (while still working with the editor) its becoming difficult to work with the page having the repeater and dataset. So much lag and my CPU and Memory usage goes up a lot whenever I open the page or start moving elements around. Can we get an option to disable it? Even without the lag I don't want items populating from the database when I'm still using the Editor.
0
5
32
Shan
Velo Certified
Velo Certified
Apr 16, 2021
In Coding with Velo
Hi, From a performance/seo perspective, are there any cons to returning seo metadata via afterRouter()? What is the preferable/best method to get router pages indexed?
0
1
28
Shan
Velo Certified
Velo Certified
Jan 04, 2021
In Tips, Tutorials, Examples
#mailchimp #mailchimp #mailchimp So Wix deprecated the MailChimp app from the Wix App Store and you do not know what to do? I got you 👊 Check out the MailChimp tutorial here https://youtu.be/qxcExzjwMxI and learn how to send subscriber information from a Wix site to your MailChimp audience list in less than 30 lines of code. Looking for the code? Here it is
Wix MailChimp Integration To Send Subscriber Info From Your Wix Website To MailChimp content media
3
3
271
Shan
Velo Certified
Velo Certified
Dec 10, 2020
In Coding with Velo
Seeing this error on each and every site, sometimes multiple times a minute. Any idea why? I have nothing related to Billing/PriceQuotes on any of my sites.
Hook afterCount for collection Billing/PriceQuotes result ignored! content media
0
0
27
Shan
Velo Certified
Velo Certified
Dec 10, 2020
In Coding with Velo
We have a cap on the total number of wix-data calls a site can make per minute, right? Suppose I have a database of ~50,000 products. How many calls does the following function consume? async function checkForProduct(stockCode) { let result = await wixData.query('products').eq('stockCode', stockCode).limit(1000).find(options); let allItems = result.items; while (result.hasNext()) {         result = await result.next();         allItems = allItems.concat(result.items);     } return allItems; } Lets assume that there are only 10 products with the queried `stockCode` - The above number of calls should be 2, right? 1 query + 1 hasNext() function Now how many calls will the below function consume? async function checkForProduct(stockCode) { let result = await wixData.query('products').limit(1000).find(options); let allItems = result.items; while (result.hasNext()) {         result = await result.next();         allItems = allItems.concat(result.items);     } return allItems; } The answer to the above should be 100, right? because the database has 50,000 products so 50 queries and 50 hasNext() functions. Another question, without the .eq() will the 50 consecutive queries even be possible? I tried but it never console.logs the 50,000 items array when queried on a backend file.
0
1
39
Shan
Velo Certified
Velo Certified
Oct 06, 2020
In Coding with Velo
Is it possible to get the entire blog post content including the images, text, etc in html? We are building a mobile app which needs to be synced with a wix site. We have a Wix blog and we need to display the blogs on the app as well. To list all the blogs we just retrieve the cover image and title to populate on the mobile app but when it comes to displaying individual blogs we have no choice than to launch an in-app browser to the clicked item's url. We would like to keep the user in the mobile app if possible but the wix blog does not return rich content like: <body> <h1>My blog title</h1><br> <br> <img src="img.jpg" alt="Alt from blog"><br> <br> <p>Blog starts here</p> </body> Not looking for interactions like allowing users to like or comment from the app (although this would be super convenient) but just the ability to display the individual blog post natively inside the app. Does someone have a workaround for this apart from launching an in-app browser?
1
1
102
Shan
Velo Certified
Velo Certified
Sep 12, 2020
In Velo Pro Discussion
#unpopularOpinion I think Wix Router is an under developed API which has massive potential. I have a couple of points to try to support my statement. First thing is the bug that runs the router function twice. It will be very helpful to allow the function to only run on server as opposed to running it on server + page. For instance: export function form_Router(request) {     console.log(request); //firing twice     return redirect('https://www.mysite.com/form-submitted'); } I expect the console.log to be fired only once but it always fires twice. Why do you need it to fire once: To expedite processing time I plan to submit a form via a router by sending values as URL parameters - something like https://mysite.com/form?name=James&email=URL_ENCODED_EMAIL&planet=Earth%20Planet And I process the submission on the backend while immediately redirecting the user to the success page - no time wasted on waiting for page to render and then corvid code to execute. This is just one example there are many more like sending events/transactions to Google Analytics Enhanced Ecommerce & processing Stripe Connect Merchant Account creation for marketplaces. What else could Wix Routers do: > Open Wix Routers to All Pages instead of just Dynamic Pages > Add `country` to Wix Router Request Object (Less Important) Users will be able to block access by IP Users will be able to redirect users to country specific subdomains/sites More ability to add Schema to better allow search engines to understand the content, I know we can use the Advanced SEO panel but many times the content needs to be dynamic - not constant Routers are bugged on Dynamic Pages I have a site where I have afterRouter() which returns schema for Google Job Post Schema and it works perfectly - see evidence. As you can see my job postings are reflected on Google due to the schema and Google Structured Data Testing Tool returns the Schema perfectly. But on other 2 sites the code doesn't work - same router, exact same code, same values but nothing the Structured Data Testing Tool does not find the schema. I brought this up with Wix Devs a while back and I was told that for the router to work it must be created from the site structure bar by selecting 'Add Router' but how come on one site where I did not do that and straightaway created a dynamic page from the database 'Add Dynamic Page' option it worked and on other sites its not working. From my view, it seems to be an issue. Would like to see this API receive more attention in 2021 s'il vous plait 🙏
0
10
163
Shan
Velo Certified
Velo Certified
Sep 07, 2020
In Velo Pro Discussion
Question regarding .authorize() to check the token validity from a backend file. Scenario: Make POST call from a page on Website 1 containing the token in the post request body. The post call is received by Website 1's (yes same website) HTTP function which tries to validate it using the .authorize() function in a jsw backend file. Results: Getting a 401 error (Request failed with status code 401) (wix-trace-id: 3aed4197828f10c0:3aed4197828f10c0:0:1) The POST call is actually made from an app I built using Wix Blocks so cannot directly import the backend function on the app. However, when I try the POST call from the Wix Blocks Editor, it works - problem is only with Live Site. I can send the HTTP requests - cors is not an issue as I've already dealt with that. Thoughts?
0
2
38
Shan
Velo Certified
Velo Certified
Aug 17, 2020
In Velo Pro Discussion
Hey guys, If I create a Multi Reference/Reference Field in 'Database A' and link it to 'Database B' -> a reference field with the field name/key of 'Database A' is created in 'Database B' automatically. Its not even marked 'System Generated' hence its getting very confusing when random field are popping up in the database. I haven't worked with Reference/Multi Reference fields a lot but is this how it normally works? Just auto-generate a field in the linked database?
0
2
356
Shan
Velo Certified
Velo Certified
Aug 10, 2020
In Velo Pro Discussion
Hello guys, Why is the Wix Data API throwing incorrect errors when the database actually does exist and the data is getting inserted properly. I know it may not be a 'big deal' but still I would like to know why random errors are being thrown like this. There has to be a reason, maybe its something to do with how I write the code or is it something related to wix?
Wix Data API throwing incorrect error content media
0
2
38
Shan
Velo Certified
Velo Certified
Aug 04, 2020
In Velo Pro Discussion
I'm trying to perfect the latency value that I return for all HTTP requests made to my Wix Site's endpoint. Can any confirm that request.headers['x-request-id'] is the timestamp when the request is made? Or is there any other value in the request object that defines the timestamp of when the request was made. https://www.wix.com/corvid/reference/wix-http-functions/wixhttpfunctionrequest
0
0
35

Shan

Velo Certified
Content Creator
Velo Expert
+4
More actions
bottom of page