top of page

Forum Posts

Tarra Maxwell
Jul 23, 2019
In Coding with Velo
Is there a "REMOVE FROM CART" api that can be used as the opposite function of addToCart() within WIX STORES. "KeepButton" in repeater adds to cart (code figured out) "RemoveButton" is not connected and I cannot find an API that will allow me to remove Another option is when the mini cart opens - is there an API i can use to capture the remove item "x" so that I can create an "if function" around clicking this button to remove the product ID.
REMOVE from Cart - Corvid API? content media
0
8
318
Tarra Maxwell
May 05, 2019
In Coding with Velo
Hello! In theory this query seems so simple, but I cannot figure out how to extract the count of multiple reference items for each row in a collection. See screenshot below. I would like to create a "COUNT" calculation in the collection as a 4th column that counts the number of Design Profiles that have each Decor Item. The result of this data hook/query should be the following and would update every time new reference items are added. (1) Design Profile referenced for Throw Blankets (3) Design Profiles referenced for Throw Pillows-Regular so on and so forth thank you in advance for any help! @stcroppe @Liran Kurtz (WIX) @Sapir (wix) @Code Queen Nayeli
Count Multiple Reference Fields in Collection content media
0
6
488
Tarra Maxwell
Apr 09, 2019
In Coding with Velo
Hey Everyone, I am hoping to get help with optimizing my code. I have multiple reference fields that are connected to 10 difference repeaters. Each one acts as a submission/dynamic form which a user signs up and fills out and then can go back and update. I have a lot of redundant code (wixData.isReferenced, and wixData.queryReferenced) which is calling the network multiple times and is slowing down the page. NOTE: it is important that the checkboxes be either inserted or replaced as they may be blank to start. Additionally, the code doesn't seem to capture all the checkboxes when selected. Let's say I check every item displayed in the repeater and save, only maybe 1/3 or half of them get saved in the collection Anyone have suggestions on how to optimize/improve? $w.onReady(() => { $w("#dynamicDataset").onReady(() => { $w.onReady(function () { wixData.query("Members") .eq("_owner", wixUsers.currentUser.id) .find() .then((results4) => { let OwnerRegistered = results4.items; let MemberID = OwnerRegistered[0]._id; let MemberOwner = OwnerRegistered[0]._owner; let Profile = $w("#dynamicDataset").getCurrentItem(); let ProfileID = Profile._id; $w("#DecorRepeater").forEachItem(($item, itemData, index) => { let DecorCheckbox = $item("#checkbox405"); let DecorID = itemData._id wixData.isReferenced("DesignProfile", "items", ProfileID, DecorID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { DecorCheckbox.checked = true } else { DecorCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "items") .then((results11) => { if (results11.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (DecorCheckbox.checked) checked.push(DecorID); wixData.replaceReferences("DesignProfile", "items", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (DecorCheckbox.checked) checked.push(DecorID); wixData.insertReference("DesignProfile", "items", ProfileID, checked) .then(() => { }) }) } }); }); $w("#RoomRepeater").forEachItem(($item, itemData, index) => { let RoomsCheckbox = $item("#checkbox406"); let RoomsID = itemData._id wixData.isReferenced("DesignProfile", "rooms", ProfileID, RoomsID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { RoomsCheckbox.checked = true } else { RoomsCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "rooms") .then((results11) => { if (results11.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (RoomsCheckbox.checked) checked.push(RoomsID); wixData.replaceReferences("DesignProfile", "rooms", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (RoomsCheckbox.checked) checked.push(RoomsID); wixData.insertReference("DesignProfile", "rooms", ProfileID, checked) .then(() => { }) }) } }); }); $w("#StyleRepeater").forEachItem(($item, itemData, index) => { let StyleCheckbox = $item("#checkbox407"); let StyleID = itemData._id wixData.isReferenced("DesignProfile", "style", ProfileID, StyleID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { StyleCheckbox.checked = true } else { StyleCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "style") .then((results11) => { if (results11.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (StyleCheckbox.checked) checked.push(StyleID); wixData.replaceReferences("DesignProfile", "style", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (StyleCheckbox.checked) checked.push(StyleID); wixData.insertReference("DesignProfile", "style", ProfileID, checked) .then(() => { }) }) } }); }); $w("#VibeRepeater").forEachItem(($item, itemData, index) => { let VibeCheckbox = $item("#checkbox408"); let VibeID = itemData._id wixData.isReferenced("DesignProfile", "vibe", ProfileID, VibeID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { VibeCheckbox.checked = true } else { VibeCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "vibe") .then((results11) => { if (results11.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (VibeCheckbox.checked) checked.push(VibeID); wixData.replaceReferences("DesignProfile", "vibe", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (VibeCheckbox.checked) checked.push(VibeID); wixData.insertReference("DesignProfile", "vibe", ProfileID, checked) .then(() => { }) }) } }); }); $w("#PriorityRepeater").forEachItem(($item, itemData, index) => { let PrioritiesCheckbox = $item("#checkbox409"); let PrioritiesID = itemData._id wixData.isReferenced("DesignProfile", "priorities", ProfileID, PrioritiesID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { PrioritiesCheckbox.checked = true } else { PrioritiesCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "priorities") .then((results11) => { if (results11.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (PrioritiesCheckbox.checked) checked.push(PrioritiesID); wixData.replaceReferences("DesignProfile", "priorities", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (PrioritiesCheckbox.checked) checked.push(PrioritiesID); wixData.insertReference("DesignProfile", "priorities", ProfileID, checked) .then(() => { }) }) } }); }); $w("#BaseColorRepeater").forEachItem(($item, itemData, index) => { let BaseColorCheckbox = $item("#checkbox403"); let BaseColorID = itemData._id wixData.isReferenced("DesignProfile", "baseColors", ProfileID, BaseColorID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { BaseColorCheckbox.checked = true } else { BaseColorCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "baseColors") .then((results11) => { if (results11.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (BaseColorCheckbox.checked) checked.push(BaseColorID); wixData.replaceReferences("DesignProfile", "baseColors", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (BaseColorCheckbox.checked) checked.push(BaseColorID); wixData.insertReference("DesignProfile", "baseColors", ProfileID, checked) .then(() => { }) }) } }); }); $w("#AccentColorRepeater").forEachItem(($item, itemData, index) => { let AccentColorCheckbox = $item("#checkbox404"); let AccentColorID = itemData._id wixData.isReferenced("DesignProfile", "accentColors", ProfileID, AccentColorID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { AccentColorCheckbox.checked = true } else { AccentColorCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "accentColors") .then((results12) => { if (results12.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (AccentColorCheckbox.checked) checked.push(AccentColorID); wixData.replaceReferences("DesignProfile", "accentColors", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (AccentColorCheckbox.checked) checked.push(AccentColorID); wixData.insertReference("DesignProfile", "accentColors", ProfileID, checked) .then(() => { }) }) } }); }); $w("#MaterialsRepeater").forEachItem(($item, itemData, index) => { let MaterialsColorCheckbox = $item("#checkbox411"); let MaterialsColorID = itemData._id wixData.isReferenced("DesignProfile", "materials", ProfileID, MaterialsColorID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { MaterialsColorCheckbox.checked = true } else { MaterialsColorCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "materials") .then((results12) => { if (results12.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (MaterialsColorCheckbox.checked) checked.push(MaterialsColorID); wixData.replaceReferences("DesignProfile", "materials", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (MaterialsColorCheckbox.checked) checked.push(MaterialsColorID); wixData.insertReference("DesignProfile", "materials", ProfileID, checked) .then(() => { }) }) } }); }); $w("#PatternsRepeater").forEachItem(($item, itemData, index) => { let PatternsColorCheckbox = $item("#checkbox410"); let PatternsColorID = itemData._id wixData.isReferenced("DesignProfile", "patterns", ProfileID, PatternsColorID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { PatternsColorCheckbox.checked = true } else { PatternsColorCheckbox.checked = false } }) wixData.queryReferenced("DesignProfile", ProfileID, "patterns") .then((results12) => { if (results12.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (PatternsColorCheckbox.checked) checked.push(PatternsColorID); wixData.replaceReferences("DesignProfile", "patterns", ProfileID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (PatternsColorCheckbox.checked) checked.push(PatternsColorID); wixData.insertReference("DesignProfile", "patterns", ProfileID, checked) .then(() => { }) }) } }); }); $w("#WhyHomeWellRepeater").forEachItem(($item, itemData, index) => { let WhyColorCheckbox = $item("#checkbox413"); let WhyColorID = itemData._id wixData.isReferenced("Members", "whyHomeWell", MemberID, WhyColorID).then((result3) => { let isReferenced3 = result3; if (isReferenced3 === true) { WhyColorCheckbox.checked = true } else { WhyColorCheckbox.checked = false } }) wixData.queryReferenced("Members", MemberID, "whyHomeWell") .then((results12) => { if (results12.items.length > 0) { ///ON SAVE - REPLACE REFERENCES/// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (WhyColorCheckbox.checked) checked.push(WhyColorID); wixData.replaceReferences("Members", "whyHomeWell", MemberID, checked) .then(() => { }) .catch((error) => { }); }); } else { //ON SAVE - INSERT REFERENCES//// $w('#SaveProfile').onClick((event, $w) => { let checked = []; if (WhyColorCheckbox.checked) checked.push(WhyColorID); wixData.insertReference("Members", "whyHomeWell", MemberID, checked) .then(() => { }) }) } }); }); $w("#SaveProfile").onClick((event, $w) => { $w("#SaveProfile").disable() wixLocation.to('/MyAccount/Home/' + MemberID) }); }); }); }); }); @stcroppe @Liran Kurtz (WIX) @Sapir (wix) @Jenee Washington @Yisrael (Wix) @Yoav (Wix) @Mike Moynihan
0
7
188
Tarra Maxwell
Feb 11, 2019
In Coding with Velo
Hello! I am looking to format the layout of the repeater I am building for my products gallery. This is customizing the same functionality of wix products/stores, with additional wix code. However, repeater layouts are only formatted as multiple rows with the more products you have. Is there a way to format a repeater element to mimic a GALLERY SLIDER where there is only one row of products and the user can use arrows to slide through the dataset items? Below is an image of the layout i want but using a repeater element. This is because repeaters have additional custom coding functionality that galleries cannot provide. Would love any help on this!
Repeater layout as Gallery Slider content media
4
18
5k
Tarra Maxwell
Jan 17, 2019
In Coding with Velo
Hello, I am looking to resolve an issue I am having where I created a custom registration sign up - but duplicate site members are being inserted into my "MemberDesignProfile" collection. The first time i click Sign up it does not catch the existing email, but it does catch it the second time i hit Sign Up. Can someone help me correct my code so that any existing site members are found and not inserted into my member collection? Thank you! Process flow of code: 1. check for any validation errors (missing inputs) 2. check for existing/matching email against "MemberDesignProfile" collection - IF - email match or validation errors - show error message - ELSE - all information is valid - THEN ---> REGISTER USER as site member ---> INSER USER RECORD in collection "Member Design Profile" Code: import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; import wixData from 'wix-data'; $w.onReady( () => { $w.onReady(function () { $w("#signupNow").onClick((event, $w) => { //Validation errors if found// let MissingFirst = ($w("#registerFirstName").valid === false); let MissingLast = ($w("#registerLastName").valid === false); let MissingEmail = ($w("#registerEmail").valid === false); let MissingPassword = ($w("#registerPassword").valid === false); //QUERY FOR EXISTING EMAIL IN COLLECTION - do not register or insert if found// let ExistingEmailQUERY = wixData.query("MemberDesignProfile").eq("emailAddress", $w('#registerEmail').value).find().then((results) => { if(results.length > 0) { $w('#emailexists').show() console.log("email exists!") } else { console.log("no match & everything filled out")} let ExistingEmail = (results.length > 0) console.log(MissingFirst) console.log(MissingLast) console.log(MissingEmail) console.log(MissingPassword) console.log(ExistingEmail) //Check for validation errors or existing email/user record// if (MissingFirst || MissingLast || MissingEmail || MissingPassword || ExistingEmail) { $w('#missinginfo').show() } else { $w('#missinginfo').hide() //IF NO MATCH OR VALIDATION ISSUES - Register Member into collection// wixUsers.register($w('#registerEmail').value, $w('#registerPassword').value, { contactInfo: { "firstName": $w('#registerFirstName').value, "lastName": $w('#registerLastName').value, "email": $w('#registerEmail').value, "password": $w('#registerPassword').value } }) .then( (result) => { $w('#success').expand(); }) .catch( (err) => { let errorMsg = err; console.log(err) $w('#error').expand(); }); //IF NO MATCH OR VALIDATION ISSUES - Insert Member into collection// let toInsert = { "title": $w('#registerFirstName').value, "lastName": $w('#registerLastName').value, "emailAddress": $w('#registerEmail').value, "password": $w('#registerPassword').value }; wixData.insert("MemberDesignProfile", toInsert) .then( (results2) => { let REGISTERmember = results2; console.log(results2) } ) .catch( (err2) => { let errorMsg = err2; console.log(err2) } ); } }) }) }) })
0
4
468
Tarra Maxwell
Dec 19, 2018
In Coding with Velo
Hello, I am using Wix input field $w(datePicker) and can't figure out how to permanently show the calendar view on page load. I was thinking that a workaround could be to "click" the calendar icon on load, however, there is no "trigger" or "Click" code in wix. How can I expand the calendar pop up on page load so it is shown to the user OR does anyone have suggestions for other date pickers I can use? Thanks! Tarra
0
5
1k

Tarra Maxwell

More actions
bottom of page