top of page

Forum Posts

Daniel Matley
May 16, 2021
In Coding with Velo
I'm looking for the best way to automatically email my Contacts recent entries in one of my collections as a table or "repeater". The frequency of these emails will be dependent on each person's settings: immediately, once per day or once per week. Initially I was thinking of using a third party service like SendGrid which accepts HTML code for a section in the email template. For instance, I create a GET "HTTP Function" from the backend which queries the "Deals" collection based on a "frequency" variable and then outputs HTML code as part of the payload being sent. Is this the best option? If so, is there an easy way to create this HTML output? Is there a way to do this all within Wix? Thanks Dan
0
0
5
Daniel Matley
May 11, 2021
In Site & Page Design
My users have option of individually selecting which of their contact information is visible or not: Phone, Email and Website. On the page where this information is displayed, all 3 items are listed beneath each other with a little icon before it. I'd like it to look nice if they choose not to display their Email for instance - I don't want a gap where it used to be! Is there a good way to achieve this? For instance, placing these items in a table or some sort of list which reduces rows depending if one or more are visible or not?
0
0
10
Daniel Matley
May 10, 2021
In Coding with Velo
I have a little bit of code where I need to set some prices depending on the user's pricing plan, but I also need to set a different price if the user isn't "subscribed". What is the best way to do this? I'm struggling because user.getPricingPlans() returns a promise, but if the user doesn't have a pricing plan then it doesn't parse the code within the .then at all. user.getPricingPlans() // is user is not subscribed, then the below is ignored. GRRR!! .then( (pricingPlans) => { let firstPlan = pricingPlans[0]; let planName = firstPlan.name; let fee = 95; switch (planName) { case "Plan 1": fee = 70; break; case "Plan 2": fee = 50; break; } } );
0
0
21
Daniel Matley
May 10, 2021
In Coding with Velo
I know this is quite easy with jQuery but I wondered if there's a way in Wix Velo so the user who is entering numbers into text inputs can preview their number as currency as they are typing: ie "$1,000,000" rather than "1000000" Thank you in advance for any help you can provide.
0
0
6
Daniel Matley
May 08, 2021
In Coding with Velo
I have quite a few input number fields intended for currency, but I'm not sure how I can display it with padding and currency symbol? ie instead of 1000 it would be $1,000
0
0
35
Daniel Matley
May 06, 2021
In Coding with Velo
Hello I have a form with an upload input which requires payment before the data can be submitted and the price they pay is dependent on the user's pricing plan. I've found this tricky to achieve because of the following: * getPricingPlans() is required to be within onReady() * form submission needs to be nested within the onClick() function, which is outside the onReady() Can anybody help explain the best way to approach this? This is what I currently have: import wixPay from 'wix-pay'; import {createDealPayment} from 'backend/pay'; import wixData from 'wix-data'; import wixUsers from 'wix-users'; let user = wixUsers.currentUser; function PricingPlan(){ user.getPricingPlans() .then( (pricingPlans) => { let firstPlan = pricingPlans[0]; let planName = firstPlan.name; let startDate = firstPlan.startDate; let expiryDate = firstPlan.expiryDate; return planName; } ); } $w.onReady(function () { user.getPricingPlans() .then( (pricingPlans) => { let firstPlan = pricingPlans[0]; let planName = firstPlan.name; let fee = 0; switch (planName) { case "Plan A": fee = 95; break; case "Plan B": fee = 80; break; case "Plan C": fee = 60; break; } $w('#textPricingPlan').text = 'Listing fee for ${planName}'; // doesn't work yet $w('#textFee').text = '£${fee}'; // doesn't work yet return fee // doesn't work yet } ); }); export function continueButton_click(event) { let toInsert = { "title": $w("#title").value, "region": $w("#region").value, "purchasePrice": $w("#purchasePrice").value, "photo": $w("#uploadImage").startUpload(), }; createDealPayment(fee,1,fee) // doesn't work yet .then((payment) => { wixPay.startPayment(payment.id) .then((result) => { if (result.status === "Successful") { wixData.insert("Deals", toInsert); $w("#continueButton").label = "Submitted"; $w("#continueButton").style.backgroundColor = "#90C32F" $w("#errorMsg").hide(); } else if(result.status === "Failed") { $w("#errorMsg").show(); $w("#errorMsg").text = "Sorry, your card has been declined. Please try again or another card."; } else if(result.status === "Pending") { $w("#errorMsg").show(); $w("#errorMsg").text = "Your payment is pending."; } else if(result.status === "Cancelled") { $w("#errorMsg").show(); $w("#errorMsg").text = "Payment cancelled."; }; }) }) }
0
0
14
Daniel Matley
May 05, 2021
In Coding with Velo
I've got a simple bit of code I can't get working. It creates an entry into my Collection but the field values are empty - and the text input fields are filled in before submitButton is pressed. import wixData from 'wix-data'; let toInsert = { "title": $w("#title").value, "region": $w("#region").value, "price": $w("#price").value, }; $w.onReady(function () { }); export function submitButton_click(event) { wixData.insert("Collection", toInsert); }
0
2
34
Daniel Matley
Apr 24, 2021
In Coding with Velo
I've made a simple form where the user fills in a form, but the Email is pre-filled by the $w code before. When I Publish the website I can see the email address has been filled in, however the value doesn't get submitted to the Collection. If I remove the code "$w("#email").value = userEmail;" and just fill in the field manually, it works fine, but that's now how I need the site to be. Can anyone understand why pre-filled inputs aren't working? user.getEmail() .then( (email) => { let userEmail = email; $w("#email").value = userEmail; } );
0
3
96
Daniel Matley
Apr 22, 2021
In Coding with Velo
I've set up a webhook to receive both new Collection records and Form records, however neither seems to be working for the custom form created on my site. Webhook tests from Wix are received but not entries that I make into my Collection via my website form. Would anybody know why this might happen? Thanks Dan
0
0
15
Daniel Matley
Apr 22, 2021
In Coding with Velo
I have a site with 3 different membership types. Rather than sell "Products", their membership gives them access to a form which they fill in and pay to make "Postings". It's the same form, it's just the price they pay depends on which membership they signed up to. Does anybody know the best way to go about this? I know there are third party apps in the marketplace but the design of those forms look different to the theme of my website, so I would really like to keep the functionality within Wix if possible. A bonus feature would be if the form is conditional; showing/hiding questions depending on their answers to previous questions. Thank you in advance to any help or steer you can give me. The extent of my coding experience is using webhooks and API calls. Thanks Dan
0
0
16

Daniel Matley

More actions
bottom of page