top of page

Forum Posts

Neff Design
Jun 14, 2021
In Coding with Velo
Mailto links are used to redirect to an email address instead of a web page URL. "mailto" typically can take any or all of these parameters: subject - for the subject line cc - for sending a carbon copy bcc - for sending a blind carbon copy body - for the message's body text However, I've begun to notice any "mailto" links out of a Wix site is only processing the subject parameter correctly. Is it a known limitation of Wix that setting a link URL via code to be limited to the email address and the subject parameters? If I set any of the parameters other than the subject, it does not seem to encode the URL correctly. Resulting in any of the other parameters being ignored by the email client. For example, this is a valid "mailto" string structure (I know because if I drop it into the browser's address bar it works as expected), but if I set a button's link property to this string, the body parameter will not pass to the email client properly. linkURL = "mailto:?subject=Check this out!&body=You can see us here www.google.com"; $w("#myButton").link = linkURL; My use case: I'm building a "share" link on my site to allow visitors to share the page's URL to various platforms (Social Media & Email). When sharing via email, the user should click the Share via Email button, be redirected to their email client, and the email's subject and body be prefilled. With Wix, it will only allow me to prefill the subject and nothing more. (1) Has anyone found a workaround to this? (2) Wix - why does this limitation exist?
0
1
291
Neff Design
Oct 17, 2020
In Coding with Velo
Looking for a good explanation and/or example of proper error handling when using Async/Await functions?
Error Handling with Async/Await content media
0
1
147
Neff Design
Oct 03, 2020
In Coding with Velo
I have a client who is trying to create an interactive game on his site due to COVID. The idea is multiple users are using the site simultaneously and any action one user takes should reflect on the other user's screens in real-time. For example, if there are 5 users, User 1, checks a box on their screen. The other 4 users should see their screen update and the box selected by User 1. I already have it locked down where only one user can make a change at a time (all users are logged in site members and I restrict the UI based on an identified user) and all actions taken by each user are immediately saved to the database. Question is, what is the best way to update everyone else's screens? The only thing I've been able to come up with is to use a denounce function and constantly go back to the database and retrieve the most recent data. Is this the best way to accomplish it, and if so at what internal should I refresh the data to not cause immense performance data? Looking for creative solutions. TIA!
0
6
104
Neff Design
Aug 03, 2020
In Coding with Velo
I have a client who wants to trigger a lightbox when the visitor clicks Add to Cart, but I can't find an event handler for the Wix Store native Add to Cart Button. I know this can easily be achieved by building a custom product page and adding a custom Add to Cart button there. However, this site & store is already well established and I'm trying to find the least invasive solution.
0
1
242
Neff Design
Jul 05, 2020
In Coding with Velo
I have a dropdown I populate via code (not directly connected to a data collection. See lines 124 & 127. Then I have an onChange event where I first check if the field is valid. See the second image. The data population seems to work as the values are present. I start off with no value in the drop-down pre-selected. PROBLEM: The weird part is, when a value is selected, it fails the validation check saying the value is missing. I can log to the console the value of the drop-down right before checking if it is valid and the value is most certainly there. Then to make it even weirder, if you toggle the drop-down options, everything works. So when the very first selection is made, it for some reason thinks the value is missing using .valid. I've even toggled to another option and then gone back to the first one and it will work. See the video. Ideas...
Dropdown .Valid fails on first selection content media
0
3
303
Neff Design
Jun 20, 2020
In Coding with Velo
I have a repeater set to a dataset with a filter configured in the dataset properties and a page size. When the dataset initially loads it works perfectly per the pre-configured filter and page size. Then I have the ability to filter the dataset via an input text field. I am using setFilter() to accomplish this. The results returned per this new filter are as expected. However, it’s not abiding by the originally set page size. I can log the dataset’s page size and it still has what I configured. How do I build a filter via code with a page size in order to “load more” via a function?
0
2
25
Neff Design
Jun 18, 2020
In Coding with Velo
I’ve seen serval older posts with the opposite of this problem (always false), but I can’t figure it out. I have a dataset with 4 records and the repeater is set to limit to 2 records per page. On data ready I call getTotalPageCount()and it outputs 2 pages, as expected. I can also call hasNextPage() and it returns true, again as expected. This is where things turn weird: I have a transparent strip below the fold of my page and set the onViewortEnter to call loadMore() which works as expected (the first time). THEN I run a check to see if there are more pages to follow (hasNextPage()), if no, collapse the strip so it will quit calling. hasNextPage() always returns true! I started logging the total number of pages and the current page index with every call. The total number of pages stays at 2 (which is correct), but the page index keeps incrementing every time the loadMore() runs. I’m sure this is a timing/callback issue, but I’ve tried everything. What am I missing/not understanding? export function stripNextPage_viewportEnter(event) { console.log($w("#dbProperties").getTotalPageCount()); // 2 console.log($w("#dbProperties").getCurrentPageIndex()); // Increments on each call      $w("#dbProperties").onReady(() => { $w("#dbProperties").loadMore()              .then(() => {                  console.log("Done loading more data");                  $w.onReady(() => {                      $w("#dbProperties").onReady(() => { let hasNextPage = $w("#dbProperties").hasNextPage();                          console.log(hasNextPage); // always returns true //If no more pages exist collapse strip if (!hasNextPage) {                              $w("#stripNextPage").collapse();                          } });                 });              });      }); }
0
8
180
Neff Design
Jun 15, 2020
In Coding with Velo
I have built a custom payment flow using the Wix-Pay API. Everything is working great in the Preview mode, but has a fatal error in the live site. Specifically, I’ve narrowed it down to the wixPay.createPayment()function. When I call createPayment I get this error in the console: “An error occurred in one of onReady callbacks” Here is a copy of my code that is called from the backend: export async function createMyPayment(propertyId, userInfo, reservationID) { // Step 3 - Create payment info object. //Retrive product details from the database let options = { "suppressAuth": true, "suppressHooks": true }; let property = await wixData.get('Properties', propertyId); let reservation = await wixData.get('Reservations', reservationID, options); console.log(reservation.checkIn); console.log(reservation.checkOut); let nights = date_diff_indays(reservation.checkIn, reservation.checkOut); let numRooms = reservation.rooms; let rateTotals = await calRate(nights, reservation.rooms, property.dailyRate, property.weeklyRate, property.monthlyRate, property.taxDaily, property.taxWeeklyRate, property.taxMonthlyRate, property.taxRate); //Set Payment Info let paymentInfo = { "items": [{ //Room Line Item name: `${property.title} (${numRooms} Rooms for ${nights} night(s)) | ${reservationID}`, price: rateTotals.roomTotal, quantity: 1 }, { //Tax Line Item name: "Tax", price: rateTotals.taxTotal, quantity: 1 } ], amount: rateTotals.grandTotal, userInfo //Customer details }; console.log(paymentInfo); // Step 4 - Call createPayment() with the payment information and return the paymentId. //return ; let payment = wixPay.createPayment(paymentInfo); return payment; // (Next, see step 5 in the client-side.) } Any clue what I’m missing? At first, I thought it was my subscription, so I upgraded to the Business & eCommerce plan, but that didn’t fix it.
0
1
22
Neff Design
Jun 11, 2020
In Coding with Velo
I have successfully implemented a custom payment flow using the WIX-PAY API such as the example here. I have been paying extra attention to the architecture of my code to ensure I take all considerations as it relates to security. Per the note at the end of the tutorial re: Security Considerations, I have ensured that I have defined my Payment Information in the backend and avoided passing those details from the client-side code, except for quantity, which is selected by the user on the UI. How do I securely include elements such as quantity in the Payment Information when they are only available on the client-side (e.g., on the UI)? Background/Context: I'm building a site for a hotel group. Here is the flow: The user selects a hotel property they wish to book. The user inputs their check-in, check-out dates, and the number of rooms (equate this to quantity). The ID of the hotel is passed from the client-side to backend where I query the data collection for all the hotel information (i.e., rates, taxes, etc.). How do I securely get the quantity to the backend in order to calculate totals and the ultimate crate Product Information? TIA!
0
0
23
Neff Design
Jun 10, 2020
In Coding with Velo
Hello! I think I know the answer to my questions but need a sanity check. I've built a custom form with the intent of calling the Wix-Pay API and then recording the transaction (form data + payment) upon submit. Before calling the Wix-Pay API I validate my form. I've successfully implemented a function that does the following: Updates the visual state of the fields (i.e., puts them in/out of an error state) via the updateValidityIndication( ) function. Then, starting at the top of the form, I determine if the field has an error and if yes I set the focus to that field. I'm doing this via checking if validity.valid is true/false, then setting focus. ✅ All the above is working as expected. ❓ My first question is about error messages. I fully understand the onCustomValidation() function, but is that the only way to trigger displaying of error messages? For example, a required field error message, which seems to be native in Wix (i.e., the field settings & validity.valueMissing) and is detected by the updateValidityIndication( ) function. ❓ My second question has to do with field setting Input Type, specifically email and phone. I get the impression, the Input Type setting is supposed to enforce some validation patter related to the selected type, is this true? If yes, does anyone know the rules/patters behind it? I'm seeing some inconsistencies.
0
0
137
Neff Design
May 28, 2020
In Coding with Velo
I have implemented successfully a custom Payment flow on my site using the Wix-Pay API by mostly following this tutorial. (Yay me!) However, the various statuses in the PaymentResults baffle me. I know what they are, but I can't figure out the use cases for them (maybe they don't apply to me). Specifically steps 7 & 8 in the before mentioned tutorial. My site flows works as such: Identify a single product from a collection. Key in user data and call the Wix-Pay API. Collect payment via the payment window (from API call). Then show success/summary page if the payment status is successful Else, if payment status is failed, show error page When would all these other status options occur in this flow (note, we are using Wix Payments and possibly PayPal): "Pending": Payment is pending payment provider approval. "Chargeback": Payment is chargeback. "Offline": Payment will be executed offline. "PartiallyRefunded": Payment was partially refunded. "Cancelled": Payment was canceled and was not processed. "Undefined": Payment status is pending payment provider input. API Reference In the tutorial I referenced above, they display a Pending screen for a pending status, but all the others are handled in the backend, and I simply don't know what would cause those statuses and if they did occur what would be proper handling of them (from a user's experience)? Thanks in advance.
0
2
553
Neff Design
May 28, 2020
In Coding with Velo
I have set up a custom payment flow on my site using the Wix-Pay API that calls a pop-up payment window. Note, this is not an app (i.e., Stores, Bookings, etc.), this is a direct call of the Pay API using Corvid. Question, in PREVIEW mode if I go through the payment flow and actually enter my credit card details, will I be charged? I'm using Wix Payments as the payment method. If yes, is there any way to test the flow without being charged? I need to ensure the post-payment flow works (success, errors, etc.).
0
0
14
Neff Design
May 23, 2020
In Coding with Velo
Does anyone know how to achieve a progress bar associated with scrolling down a page? A great example is this Wix site: https://www.studio1design.co/ See the blue progress bar directly under the header as you scroll down the page. Two main questions: What event would you use to trigger the function of expanding/contracting the line? What property do you use to set the line's width? Thank you! My website, created using Editor X: neff.design
0
11
1k
Neff Design
Mar 06, 2020
In Coding with Velo
Is there any way to have the responsiveness of a Strip with the controls/behavior of a Slideshow? I need to have a slideshow with both images and text "columns", but it needs to be responsive enough to screen sizes. In this example, you can see the slideshow like element have two columns: image and text. When the window is resized it has the responsiveness like a strip with columns. Any suggestions on how to achieve this?
Responsive Slideshow content media
0
1
248

Neff Design

More actions
bottom of page