top of page

Forum Posts

Logan Eldridge
Feb 10, 2021
In Coding with Velo
Is there an event handler which will trigger when an auto renewal payment occurs?\ I know I can track the OnPlanPurchase event, but what about next month when the members card is going to be auto charged, what event handle will watch for the reoccured transaction?
0
0
10
Logan Eldridge
Feb 10, 2021
In Coding with Velo
For some reason I can not get wixPaidPlans_onPlanPurchased(event) to trigger in the backend events.js file. import wixData from 'wix-data'; export function wixPaidPlans_onPlanPurchased(event) {     console.log("purchased reoccuring"); let paymentNET = ((event.payment.amount * 0.971) - 0.30).toFixed(2); let paymentDetails = { 'paymentID': event.order.id, 'paymentAmount': event.order.price.amount, 'paymentNET': paymentNET, 'paymentItems': event.order.planName, 'transactionStatus': event.order.paymentStatus, 'transactionId': event.order.wixPayOrderId, 'data': event.order     };     wixData.insert("Payments", paymentDetails)         .then((results) => {             console.log("inserting into transactions database"); let item = results; //see item below         }).catch((err) => { let errorMsg = err;             console.log(err);         }); } Any ideas what is going on. At one point it was working (sort of) sometimes it would trigger. But not it is not triggering at all. Thank you for the help.
0
4
60
Logan Eldridge
Dec 31, 2020
In Coding with Velo
Hi Everyone, I am looking to mark the "payment status" as "Unpaid" on a member who purchased a pricing plan using the "manual" payment option. That way I can go mark it as paid later when I have received the cash/check. However, it seems any purchase I create (event manual) using the corvid wix-paid-plans method just goes into the subscriptions as "Paid". Any suggestions? Thank you
0
0
28
Logan Eldridge
Mar 03, 2020
In Coding with Velo
Hello everyone, Quick question. I was looking thought the documentation and found te ability to adjust things such as price and weight of a product variant, as well as get many other data types of a specific product, however, I don't seem to see a method of manually changing product inventory levels via wix code. Is it not possible to adjust inventory levels? The point I am getting at is that registrants who buy a registration get a T shirt as well. Currently I am managing shirt inventory via a database and just changing the numbers by using a function in the event.js backed file after a customer checkouts to adjust the shirt inventory properly. Thank you for your time.
0
1
172
Logan Eldridge
Feb 14, 2020
In Coding with Velo
the addProductsToCart promise appears to be sending the user to the cart page when used. However, I have another section for the user to fill out before they can go to the cart page and I don't want to add the items after that section. I would rather the items add then they get to the "additional sales" section before going to the cart. This only happens on mobile. The desktop version is working fine. it doesn't take the user straight to the cart?! Any ideas how to prevent this automatic cart thing on mobile devices. Thank you. Sincerely, Logan
2
1
168
Logan Eldridge
Feb 05, 2020
In Coding with Velo
I have a dropdown box in a multistate box. I clear this drop down when the user chooses to go through the multistate box registration again. However, on the second time around after clearing, it seems like the options are not being set to the dropdown because the code is running just before the dropdown is actually rendered. How do i make a promise that waits till the dropdown is completely rendered before executing the code to apply the drowpdown options? thank you -Logan
0
1
26
Logan Eldridge
Jan 28, 2020
In Coding with Velo
Hello everyone, I currently have this code running in the back end: export function massReminderEmail() { console.log("clicked"); wixData.query("2020_Registrants") .ascending("givenName") .limit(1000) .find() .then((results) => { if (results.items.length > 0) { let participant = results.items; //see item below console.log(participant[0].givenName, "starting"); for (let i = 0, p = Promise.resolve(); i < results.items.length; i++) { p = p.then(_ => new Promise(resolve => setTimeout(function () { console.log(i, participant[i].fullName, participant[i].email); sendPromoMail(participant[i].givenName, participant[i].email); //$w('#massEmail').label = (i + 1) + " / " + results.items.length; //no that this is in the back end i cant use this, how can i pass this data //back to edit the label still? if(i===results.items.length-1) { sendPromoMail("yes", "me@mydomain.org"); //let me know when all emails sent } resolve(); }, 5000) )); } } }) .catch((err) => { let errorMsg = err; }); } This code is working perfectly fine. That is for at least the 12 database entries i have tested it with. So the purpose of this code is it sends out a reminder email to each registrant in a database, but it puts a 5 second delay between each email call. I call this backend function from a button click on the front end. I previously had this code running front end, but the browser had to be left open as each email sent. I want to avoid that by having it just done in the backend. (cause it could take up to an hour to send all the emails given a 5 second delay for each) Anyway my main questions: 1) Will this work for a lot more registrants (say 1000) or will the wix backend eventually just time out? I remember reading something about max compute time in wix backend. 2) Is this the best way to have a delay between each email send? or can it be done safer/cleaner? 3) How can I send data back to front end to update a text element as to the value of i to show what email number it is on. Thank you all for your time. I am getting used to using promises so please let me know if something could be done better. -Logan
0
1
46
Logan Eldridge
Jan 23, 2020
In Coding with Velo
I have a repeater with multiple results. In each repeater is a textbox and a button. When the button is clicked, an HTML iframe is called with a promise for the qr scan data. However, if while waiting for this message, the user clicks the button in another result in the repeater, then the Qr scan data that is returned fills in the textbox of both of the results. Any suggestions to fix this? $w("#RegRep").onItemReady(($item, itemData, index) => { if (itemData.checkedIn) { $item("#CheckinButton").label = "Re-Scan?"; $item("#CheckinButton").style.color = "rgb(209, 6, 6)"; $item("#CheckinButton").style.backgroundColor = "rgb(252, 223, 3)"; } const repeatedButton = $item("#CheckinButton"); const bibInputField = $item("#bibInput"); bibInputField.onFocus((bibScan) => { $w("#html2").postMessage("scan"); scannerWait = false; $w("#html2").onMessage((bibResult) => { scannerWait = true; console.log(bibResult.data); if (bibResult.data.length === 4) { bibInputField.value = bibResult.data; } }); }); repeatedButton.onClick((event) => { let bibNm = $item("#bibInput").value; let checkinButton = $item("#CheckinButton"); //the button that is in each repeater entry if (!bibNm) { //if the input box in the repeater is empty $w("#html2").postMessage("scan"); //telling iframe is start the scanner $item("#CheckinButton").label = "Scanning"; scannerWait = false; $w("#html2").onMessage((bibResult) => { //this is the promise being waited on that is causing issues if the user clicks the checkin button on a different repeater entry. scannerWait = true; console.log(bibResult.data); if (bibResult.data.length === 4) { bibInputField.value = bibResult.data; $item("#bibInput").enable(); $item("#CheckinButton").label = "Confirm"; } }); } else { checkDuplicate(bibNm) .then((bibDuplicate) => { console.log(bibDuplicate); if (bibNm > 999 && bibNm <= 9999 && !itemData.checkedIn && !bibDuplicate) { $item("#bibInput").disable(); itemData.bibNum = bibNm; itemData.checkedIn = true; $w("#2020RegDataset").save() .then((item) => { checkinButton.label = "Re-Scan?"; checkinButton.style.color = "rgb(209, 6, 6)"; checkinButton.style.backgroundColor = "rgb(252, 223, 3)"; refreshing(); }) .catch((err) => { let errMsg = err; }); } else if (bibDuplicate && bibNm) { bibNm.enable(); bibNm.value = undefined; $item("#CheckinButton").label = "Re-Scan"; $item("#CheckinButton").style.backgroundcolor = "rgb(255, 255, 255)"; $item("#CheckinButton").style.Color = "rgb(252, 223, 3)"; wixWindow.openLightbox("Duplicate Bib Error"); } }); } }); });
0
8
76
Logan Eldridge
Jan 23, 2020
In Coding with Velo
I have a dataset connected to a repeater to list out information from a specific collection. Is it possible to create a "polling interrupt" type behavior where if any new information is added to the collection, whether this be from another session somewhere else, the information displayed in the repeater is updated to match. So like say maybe every 10 seconds the dataset is refetched. is this possible?
0
4
36
Logan Eldridge
Dec 06, 2019
In Coding with Velo
Is it possible to pass data to a lightbox while it is open?
0
8
161
Logan Eldridge
Nov 20, 2019
In Coding with Velo
So there is no way to use a camera with chrome since they depreciated the iframe and the following has to be implemented in the top level HTML <iframe src="https://example.com" allow="geolocation; microphone; camera"></iframe> However, we have not been given a method to change the attributes of iframes in wix code besides the allow full screen and the src ones. has anyone found a backend workaround to use real jquery to do something like: 1) Using attr: $w("#iframe").attr("allow", "camera"); or 2) Using DOM object: $w("#iframe")[0].setAttribute("allow", "camera"); Thank you all for your time. I really wish wix would add a handler to change the allow attributes of the iframes since they wont allow us to embed html in our sites.
1
7
2k
Logan Eldridge
Aug 19, 2019
In Coding with Velo
Is there a way or work around to actually clear a users current cart that is integrated with the wix store api? I only see a method to be able to get the items that are currently in the cart, but now way to edit these items.
0
1
608
Logan Eldridge
Aug 17, 2019
In Coding with Velo
Has anyone figured out a way to allow the iFrames we can use to get the permissions needed to use the camera. I would really appreciate if anyone had some insight on a potential work around. -Logan E
0
1
93
Logan Eldridge
Aug 16, 2019
In Coding with Velo
Hello community, I have a long database list of race registrants, but I couldnt get my page to load today and then figured out why. Last night I imported a tun of dummy registrants to test out the check out process. I was able to get my page to laod by limiting the data set to only display 20, but I really would like to let it display all of the entries and allowing for searching. Any ideas? any way to add a scroll wheel to only the repeater and not just making a huge long page?
0
3
81
Logan Eldridge
Aug 16, 2019
In Coding with Velo
Hello Community, I was wondering if anyone has determined a way to make the wix pay api act similar to the wix store cart such that it cant be on its own checkout page and not just a light box. The reason I do not want to just use the wix store API is because I am not exactly selling physical items or digital items on my site. we are selling participant race entries so I have to have the customer registration for and the ability to add multiple participants and select shirt sizes. So I would prefer if this pay api could be made into a a cart page. Side not I already have the website configured with the wix store api, however it is kind of annoying because I have a temporary cart database that then moves the purchased entries into the registered database after checkout, but I had to make a custom code to check and make sure some participants were not moved from the cart when checking out to prevent free registrations. Also, using the wix store api, this allows the customer to change the quantity, however i have the code making each registrant have their name added to the custom text field so each registration all thought it is the same product, is a different item in the cart with unique custom text fields being their name. Any way this would be a whole lot of easier If i could just control the whole payment process, but I need to figure out how to make the wix pay api more of a page than just a lightbox SORRY FOR THE LONG AMOUNT OF INFO ONLY THE FIRST PARAGRAPH IS IMPORTANT I GUESS. Thank you everyone -Logan Eldridge
2
1
93
Logan Eldridge
Aug 12, 2019
In Coding with Velo
Hello Community, ultimate goal: So I'm trying to make my a database shareable by link in a google sheet. However I wan't to create a new sheet populated with the database data each time a button is clicked to prevent duplication. This way the user requesting the data can download the csv from google sheets. **unless there is a what to download a csv on user end from the wix databases which I couldn't figure out** Any way, thanks for your help! -Logan
1
1
96
Logan Eldridge
Aug 11, 2019
In Coding with Velo
Hello Wix community. I have a bit of a predicament. I am attempting to list a users cart items in a repeater. However, my code seems to be returning an empty promise when I do it in preview mode. When I console.log the array it seems to read correctly, it wont read in preview. Also I tried to call one of the items in the array and it creates an error when I do inspect element using chrome. Here's my back end code. import wixStores from 'wix-stores-backend' export function getCurrentCart() { return wixStores.getCurrentCart(); } and here is my site page code. Any clues? $w.onReady(function () { console.log(getCurrentCart()); var currentRegInCart = getCurrentCart(); console.log(currentRegInCart.lineItems[0].customTextFields[0].value); // handle creation of new repeated items $w("#registrantsInCart").onItemReady(($item, itemData, index) => { $w("#registrantsInCart").expand(); $item("#repFirst").text = currentRegInCart.lineItems[0].customTextFields[0].value; }); }); any suggestions. All your help is appreciated.
1
1
168
Logan Eldridge
Jul 23, 2019
In Coding with Velo
Hello wix community. I am trying to copy an entry from my "tempCart" database into a "2020_Registrants" database using insert() from the event.js after a new order is created. here is my code that is in the event.js. I have test messages to insert into the collection, but nothing is showing up in the database. import wixData from 'wix-data'; import wixStoresBackend from 'wix-stores-backend'; wixData.insert("2020_Registrants", {"errorTest":"1"}); export function wixStores_onNewOrder(event) { wixData.insert("2020_Registrants", {"errorTest":"2"}); let newOrderId = event.orderId; wixData.query("Stores/Orders") .eq("_id", newOrderId) .find() .then((results) => { if (results.items.length > 0) { wixData.insert("2020_Registrants", {"errorTest":"3"}); let item = results.items[0]; let reg = item.lineItems; console.log(item); console.log(item.lineItems); for (var i = 0; i < reg.length; i++) { wixData.insert("2020_Registrants", {"errorTest":"4"}); let regID = reg[i].customTextFields[4].value; wixData.query("tempCart") .eq("participantID", regID) .find() .then((regResult) => { if (results.items.length > 0) { wixData.insert("2020_Registrants", {"errorTest":"5"}); let regPart = results.items[0]; let registrantID = regPart.participantID; if (registrantID === regID) { wixData.insert("2020_Registrants", {"errorTest":"6"}); wixData.insert("2020_Registrants", regPart); } } else { wixData.insert("2020_Registrants", {"errorTest":"7"}); console.log("Failed to Retrieve"); // handle case where no matching items found } }) .catch((err) => { wixData.insert("2020_Registrants", {"errorTest":"8"}); let errorMsg = err; }); } } else { wixData.insert("2020_Registrants", {"errorTest":"9"}); console.log("Failed to Retrieve"); // handle case where no matching items found } }) .catch((err) => { wixData.insert("2020_Registrants", {"errorTest":"10"}); let errorMsg = err; }); }
0
0
144
Logan Eldridge
Jul 21, 2019
In Coding with Velo
Hi Wix Community, I am hoping you'll be able to help me out here. I have rage registrations as a product: 5K and 10K Now. I had made a variant of each type of shirt ie: (unisex,female,youth, none) (XS,S,M,L,XL) And 5K and 10K were separate products. However, my problem now is, how can I keep track on inventory of the shirts when the 5k and 10k have their own apparent shirt inventory this way. Is there a way that I can just create a Shirt Item such that, for ever race registration in cart, a shirt is free. Essentially a shirt comes with every registration. This would allow me to only track one shirt inventory, but how can I make the cart only discount the amount of shirts for the amount of registrations being purchased using WIX CODE. Thank you for your time -Logan Eldridge.
0
0
16
Logan Eldridge
Jul 20, 2019
In Coding with Velo
So it's possible to add items to the cart icon, however is it possible to remove items from cart using wix code?
0
1
589

Logan Eldridge

More actions
bottom of page