top of page

Forum Comments

Membership purchase payment options
In Wix Classic Editor
Backend code in IDE on wix studio
In Wix Studio
velo-ninja
Dec 10, 2023
Why you do not show your whole CODE ? 1. FRONTEND 2. & BACKEND Looks like a SYNTAX-ERROR on BACKEND ? And did you realy took a look into the VIDEO ??? It was even mentioned --> That the API you are using will be DEPRICATED soon. And --> YES <-- it is like it is --> you are already using a DEPRICATED OLD VERSION of an API. And --> YES <-- of course we have a SYNTAX-ERROR here, not even only a SYNTAX-ERROR, your whole code looks not very good. 1. Without have taken a look now onto the new Wix-Plans-APIs, i am almost sure, that you are not able to differ between BACKEND & FRONTEND, because your code it showing this clearly. Is this your whole code? import wixData from 'wix-data'; export const getPlans = async ()=> { const results = await wixData.query("PaidPlans/Plans").find() return results.items; } a) You are importing Wix-Data-API, but i can not see that you are importing Wix-Pricing-Plans-API. b) There is also a big difference BETWEEN an imported BACKEND-API and a FRONTEND-API. c) How to get a pricing plan by ID.... import wixPricingPlansBackend from 'wix-pricing-plans-backend'; export function myGetPlanFunction() { const id = '001c0674-d7c9-4c77-acb5-b492b427b201'; return wixPricingPlansBackend.getPlan(id) .then((plan) => { console.log(plan); }) .catch((error) => { console.error(error); }); } d) Doing the same with a transfered ID (from frontend if needed). import wixPricingPlansBackend from 'wix-pricing-plans-backend'; export function myGetPlanFunction(id) { return wixPricingPlansBackend.getPlan(id) .then((plan) => { console.log(plan); }) .catch((error) => { console.error(error); }); } First check the NEW APIs... https://www.wix.com/velo/reference/wix-pricing-plans-backend/getplan
Content media
0
0
product price when option selected
In Velo (Wix Code)
change product price with getVariants()
In Velo (Wix Code)
velo-ninja
Dec 10, 2023
Just some hours ago, i posted this one on another FORUM.... I am playing a little bit around with the Wix-Stores-App (investigating it a little bit). I found now a second disatvantage of the Wix-Stores-APP.Maybe someone already has encountered the same problems. -Once you settep-up your Wix-Store, you generate some products through your Wix-Dashboard. In some cases, you will generate PRODUCTS which will have different kind of VARIANTS (different colors, different sizes and so on). Ok, after generating such a PRODUCT with diffeerent VARIANTS, the product gets stored inside of the DATABASE, till here everything seems to be good. But what if a CUSTOMER wants to have for each VARIANT, a unique (out of the variant-product-values) generated URL ??? Example:Product-A: Bottle with 100mlProduct-B: Bottle with 200mlProduct-C: Bottle with 300ml The ‘BOTTLE’-product itself is all the same, just having different ml-volume. Inside of the database → PRODUCTS <— the product gets generated just once and has a basic (automatically generated) URL something like → …/website/product-page/bottle We remember → we have created 3x different VARIANTS → and now on our PRODUCT-PAGE we can find an automatic generated DROPDOWN where we can choose the VARIANT. QUESTION-1: Where to find the TRIGGER for the DROPDOWN? (onChange) ??? …seemed to be promissing, but for wix-studio only ??? 2023-12-09 23_46_39-onChoiceSelected - Velo API Reference - Wix.com1929×1484 141 KB QUESTION-2: How to get 3-different generated URLs for the ‘BOTTLE’-product…a) …/website/product-page/bottle?=100mlb) …/website/product-page/bottle?=200mlc) …/website/product-page/bottle?=300ml This question is related to the following one… Wix-Stores ---> Getting the selected VARIANT Ask a question When working with —> Wix-Stores-App, i have the problem to get the trigger/event for the selection of an VARIANT → for example inside the corresponding DROPDOWN. The dropdown is an automatically added one on the PRODUCT-PAGE, where you can select a PRODUCT-VARIANT. The question is, how to get the event-trigger for this dropdown? How to know which variant was selected after choice has been done ??? Dropdown on PRODUCT-PAGE… [2023-12-09 18_38_04-פינצטה מקצועית לגבות _ ORA Clinic und 4 weitere… I mean i have already created/found a workaround, but maybe there are better solution for it → (not to be forced to generate some BYPASS-CODING and DESIGNING). Additional-Info: In the ordinary HTML/JS-World i probably would use something like… Change URL But Wix surely will not allow changes to the URL path using the pushState method directly due to security restrictions. By using the pushState-Method i shoulld be able to generate what i want (changing the URL inside my BROWSER-INPUT DIRECTLY WITHOUT REDIRICTION OR RELOADING OF MY CURRENT PAGE). If someone ask himself, if the described issue is able to be resolved?→ YES, it can be resolved → but by a somekind of a very tricky and time-consuming BYPASS-CODING and restructuring of the whole PRODUCT-PAGE. I am searching for a simple solution. As i can see → 2020 <–there was already the same/similar problems… On WIX Stores, Product page, how to add a button that opens a URL Ask a question The URL is in additionalInfoDescription2. and additionalInfoTitle2 = “LINK” Ive been going round in circles for hours. HOW can I do this?? HELP And today, people with the same looping questions… Unique URL for each product variant Ask a question I am in need of having a unique URL for each product variant on my wix store. How can I make this happen ? Query parameter might work ? or any other way ? i just need a unique url for each size of my product variant. example: mysite.com/products/facesoap?size=100ml mysite.com/products/facesoap?size=200ml currently when i change size on my product page the url stays exactly the same . Could wix-location help out in this case? External Imagewix.com wix-location-frontend - Velo API Reference - Wix.com The wix-location-frontend module contains functionality for getting information about the URL of the current page and for navigating to other pages. …or maybe Wix-Router?? External Imagewix.com wix-router - Velo API Reference - Wix.com This module contains the APIs for code routers and data binding router hooks. Luckely there are still post to be found of some good programmers… How to make repeater items pages have their own URL Ask a question I just want to make something like this [image] In this image i searched keyword “mobile” and it showed me the result page and i clicked on the next page here you can see the url in the bar changes to pg_2 what indicates that tpage 2 has it’s own URL so in case of repeater on wix the results reloads in repeater without changing the url of the page So if user want to copy url for the specific page he cannot do this @Eitan Waxman --> Maybe some very good stuff for your next VIDEO ??? You seem to be on a good coding level ! 😉 Would like to see --> what would be your solution. Surely no challange for you. !!! HAPPY CODING !!!
Content media
0
0
Can’t find the Repeater YouTube video promised
In Courses
velo-ninja
Dec 10, 2023
Do you really need a VIDEO for that? Ok, let's go!!!!! --> we will do it also without any VIDEO. 1. Let's imagine you have opened your Wix-Editor (doesn't matter on wich one you are working). 2. You also have activated the DEVELOPER-MODE, to be able to write some CODINGS on your Wix-Website. 3. Here we go... we want to do what exactly? Populating a --> REPEATER??? 4. Ok, time to do some codings.... import wixData from 'wix-data'; 5. Ready the page... $w.onReady(()=>{............................}); 6. Writing the query-function.... function getData() { return wixData.query('myDB') .find() .then((results)=> { if(results.items.length > 0) { console.log(results.items[0]); return results; } else { // handle case where no matching items found } }).catch((err)=> {console.log(err);}); } 7. Calling our generated function inside the onReady-Block, to get data from DB. import wixData from 'wix-data'; $w.onReady(async()=>{console.log('Page ready...); let myData = await getData(); console.log('Data: ', myData); }); function getData() { return wixData.query('myDB') .find() .then((results)=> { if(results.items.length > 0) { console.log(results.items[0]); return results; } else { // handle case where no matching items found } }).catch((err)=> {console.log(err);}); } 8. Once we got our data from DB and saved inside a VARIABLE (myData), now we are able to push it for example into our REPEATER. import wixData from 'wix-data'; $w.onReady(async()=>{console.log('Page ready...); let myData = await getData(); console.log('Data: ', myData); $w("#myRepeater").data = myData; }); function getData() { return wixData.query('myDB') .find() .then((results)=> { if(results.items.length > 0) { console.log(results.items[0]); return results; } else { // handle case where no matching items found } }).catch((err)=> {console.log(err);}); } 9. The rest of what and how to do, you will learn while reading the following post.. https://www.thewixwiz.com/forum/velo-wix-code/search-simultaniously-19-tables !!! GOOD-LUCK & HAPPY CODING !!!
Content media
0
0
Search simultaniously 19 tables
In Velo (Wix Code)
velo-ninja
Dec 09, 2023
!!! HAPPY CODING !!!
Content media
0
Problem in my store code
In Wix Classic Editor
velo-ninja
Dec 09, 2023
Already --> resolved ???
0
0
Search simultaniously 19 tables
In Velo (Wix Code)
velo-ninja
Dec 09, 2023
Each data-row inside of your database is a repeated row inside a repeater. When you have 50-data-rows inside of your DB and you load these 50 data-rows into your repeater, your repeater will show you 50 items generated out of your database. As we know, everything starts with --> IMPORTS & $w.onReady if it comes to wix-coding. If you are working with datasets, an import of (for-example) Wix-Data is not needed. At this moment i want to warn those beginners, who tries to mix Wix-Data-APIs with DATASET-CONNECTION and settings inside the PROPERTY-PANEL, in most cases --> those beginners will cry for even mire help, because failing to build up a nice working VELO-CODE based setup. So let's start with first preparing some EXAMPLE-DATA for our REPEATER.... let exampleData = [ { "_id": "1", "firstName": "John", "lastName": "Doe", "image": "http://someImageUrl/john.jpg" }, { "_id": "2", "firstName": "Jane", "lastName": "Doe", "image": "http://someImageUrl/jane.jpg" } ]; Following by ---> $w.onReady() which will load the wix-page and get our page ready... $w.onReady(()=> {............................}); Because we are totaly BEGINNER, we trying always to use CONSOLE-LOGS, to myke our own generated CODE more readable, understandable and plausible..... $w.onReady(()=> {console.log('page ready...'); }); Wohooo first initial step done. So what now about our repeater and the colored repeater data-rows? Not possible to do so? Let's check it out!!! First we still need some code to load the EXAMPLE-DATA into our REPEATER... $w('#repeater1').data = exampleData; And when the REPEATER got his data, we need to make sure, so the repeater shows all data automatically, when the repeater is ready.... $w('#repeater1').onItemReady(($i, iData, i)=>{ }); The MAGIC-TRIPPLE-i !!! Ok, what next? What else do we need? Of course we need still some elements to be added into ou repeater like .. a) Text-element b) Buttons c) Dropdowns d) Images what ever. In our case we will need a box, which we will add to our repeater setting it's color to 100%-transparent --> this makes the added box invisible. We also strech the box to the full size of a repeated item (container) inside our repeater --> this will be our BACKGROUND later, for showing color on specific lines. Till here everything clear ? So let's continue .... (summarizing our code)... we will get some code like... let exampleData = [ { "_id": "1", "firstName": "John", "lastName": "Doe", "image": "http://someImageUrl/john.jpg" }, { "_id": "2", "firstName": "Jane", "lastName": "Doe", "image": "http://someImageUrl/jane.jpg" } ]; $w.onReady(()=> {console.log('page ready...'); $w('#repeater1').onItemReady(($i, iData, i)=>{ console.log('Item-Data: ', iData); console.log('Index: ', i); }); }); Let'S say our added box-element has the ID --> 'boxBG' <-- which will represent the colored background. We have in this example a data of 2-items (2x-data-rows), which we are pushing into the repeater. Inside the repeater there are some elements, including text for first and last-name, and an image + button...... let exampleData = [ { "_id": "1", "firstName": "John", "lastName": "Doe", "image": "http://someImageUrl/john.jpg" }, { "_id": "2", "firstName": "Jane", "lastName": "Doe", "image": "http://someImageUrl/jane.jpg" } ]; $w.onReady(()=> {console.log('page ready...'); $w('#repeater1').onItemReady(($i, iData, i)=>{ console.log('Item-Data: ', iData); console.log('Index: ', i); //------------------------------ $i('#myImageIdHere').src = iData.image; $i('#txtFirstname').text = iData.firstName; $i('#txtLastname').text = iData.LastName; $i('#myButtonIdHere').onClick(()=>{ console.log('click'); }); }); }); And now the final job we have to do to get our wished functionality.... to get our colorized Rows..... let exampleData = [ { "_id": "1", "firstName": "John", "lastName": "Doe", "image": "http://someImageUrl/john.jpg" }, { "_id": "2", "firstName": "Jane", "lastName": "Doe", "image": "http://someImageUrl/jane.jpg" } ]; $w.onReady(()=> {console.log('page ready...'); $w('#repeater1').onItemReady(($i, iData, i)=>{ console.log('Item-Data: ', iData); console.log('Index: ', i); //------------------------------ $i('#myImageIdHere').src = iData.image; $i('#txtFirstname').text = iData.firstName; $i('#txtLastname').text = iData.LastName; //----------------------------------- if(i===1){$i('#boxBG').style.backgroundColor='red';} if(i===3){$i('#boxBG').style.backgroundColor='green';} if(i===7){$i('#boxBG').style.backgroundColor='blue';} $i('#myButtonIdHere').onClick(()=>{ console.log('click'); }); }); }); You of course also can add a special function to mark for example every second or third row to mark it automatically..... and so on...... .....continue......
1
Search simultaniously 19 tables
In Velo (Wix Code)
Customizing a table using velo
In Velo (Wix Code)
velo-ninja
Dec 08, 2023
Looks like a job.
0
0