top of page

Forum Posts

Sinedstro Cythan
Jun 14, 2025
In Velo (Wix Code)
Goal: Build features for my site at a semi pro level Question: If the above was your goal, & you had to start from the beginning, what would your fastest way? I’d appreciate guidance from as many coders wrt; what programming language/frameworks/courses/sites/apps/learning systems/processes to follow Pls also consider futureproofing for Wix’s transitions to coding languages/frameworks What have you already tried: I’ve coded many features following tutorials, but as a non coder
0
0
5
Sinedstro Cythan
Apr 11, 2025
In Velo (Wix Code)
Question: How to Display Average Rating from Wix Comments app, on Dynamic pages Requirement Background: I’m using Wix Comments as a workaround to Wix Reviews, as the latter can only be integrated with Wix Stores & not other listing types like services, properties etc Below is a Wix Comments Widget showing the exact component I need. However I want to show that info elsewhere; on the same page or another, via a text box or ideally a Ratings Display element. ![Screenshot 2025-02-21 111254|690x387](upload://lYZPAgSQwQC2xpo0btrNMEusHas.png) [I’m not a coder but have built many features with online resources. I’ve been trying this for months but hitting walls, if y’all can find the way that would be mean a lot.] Specific requirement & attempts: The main challenge of querying & displaying the average rating was finally achieved & confirmed possible. But it only works for 1 comments widget. This is the working code: // Working code for ***backend web module import { Permissions, webMethod } from "wix-web-module"; import { comments } from "wix-comments.v2"; import { elevate } from "wix-auth"; const COMMENTS_APP_ID = "91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e" export const getAverageRating = webMethod( Permissions.Anyone, () => { return queryComments() } ); async function queryComments() { const elevatedQueryComments = elevate(comments.queryComments) const { items } = await elevatedQueryComments(COMMENTS_APP_ID).find(); console.log("items", items); const totalRatings = items.reduce((a, b) => a + b.rating, 0); const averageRatings = totalRatings / items.length; return averageRatings; } // Working code for frontend import { getAverageRating } from 'backend/comments.web' $w.onReady(async function () { const averageRating = await getAverageRating(); $w("#textbox").text = `Average Rating: ${averageRating}`; }); ⚠️However, the requirement is not yet solved. Now I'm stuck at the following point; as I need this on dynamic pages, all that's needed, is to show the average rating **based on each dynamic page** (using resource Id?) For a coder this should be a very basic modification of a few lines. **1) How can this bit be modified properly? *2) Also, if you can make a substitution to use a Ratings Display instead of a text box that'd be great❤️ GPT's attempt at modifying the basic working code, doesn't work: // specialized GPT's reply to 'Modify the previous code to query comments based on resourceId by querying resourceId' import { Permissions, webMethod } from "wix-web-module"; import { comments } from "wix-comments.v2"; import { elevate } from "wix-auth"; const COMMENTS_APP_ID = "91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e"; export const getAverageRating = webMethod( Permissions.Anyone, (resourceId) => { return queryComments(resourceId); } ); async function queryComments(resourceId) { const elevatedQueryComments = elevate(comments.queryComments); // Query comments filtered by resourceId const { items } = await elevatedQueryComments(COMMENTS_APP_ID) .eq("resourceId", resourceId) // Querying based on resourceId .find(); if (!items || items.length === 0) { return { averageRating: 0, totalComments: 0 }; // Handle case when no comments are found } console.log("Filtered Comments:", items); const totalRatings = items.reduce((sum, comment) => sum + (comment.rating || 0), 0); const averageRatings = totalRatings / items.length; return { averageRating: averageRatings, totalComments: items.length }; } **Additional info:** API ref: [Velo Deps Wix Comments V 2 Comments Introduction | Velo](https://dev.wix.com/docs/velo/apis/wix-comments-v2/comments/introduction) All this can be tested on your end. All that's needed is the Wix Comments app with Ratings on. Querying is all done from the API directly, & has no connection to CMS collections. Wix Comments doesn't natively have a 'CMS collection', but only a simple page under apps. When leaving comments, better login & do, rather than entering username which can mess up if not proper
0
0
12
Sinedstro Cythan
Mar 25, 2025
In Velo (Wix Code)
Goal: Display Average Rating from wix-comments.v2 Background: I’m using Wix Comments as a workaround to Wix Reviews, as the latter can only be integrated with Wix Stores & not other listing types like services, properties etc I'm not a coder but have built many features with online resources. I've been trying this for months but hitting walls, if y'all can find the answer that would be mean a lot. Below is a Wix Comments Widget showing the exact component I need. However I want to show that info elsewhere; on the same page or another, via a text box or ideally a Ratings Display element. What I've tried: GPT & Velo Assistant code. But none of the code work, due to a few unknown IDs or syntax. Velo Asst. seems close to the solution. Here are different potential approaches. 1) 2) 3) Additional info: API ref: https://dev.wix.com/docs/velo/apis/wix-comments-v2/comments/introduction The following limited approach may have potential but has only worked for the following use case.
Display Average Rating from Wix Comments content media
0
2
35
Sinedstro Cythan
Jan 30, 2025
In Velo (Wix Code)
What I'm tryna achieve: I want the Ratings Display to show Wix Comments instead of Wix Reviews Background: Because I’m trying to use Wix Comments as a workaround to Wix Reviews, as the latter can only be integrated with Wix Stores & not other listing types like services, properties etc On the front end, Wix Comments is almost as feature rich as Wix Reviews. However it isn’t fully fleshed out, missing the following major func: It doesn’t natively connect to CMS, so its very difficult to view & manage comments when they accumulate. It’s stored in a separate basic page under the Wix Comments app. Many thanks!
Connect Wix Comments to Ratings Display content media
0
2
28
Sinedstro Cythan
Jan 30, 2025
In Velo (Wix Code)
Background: Paid members can create listings What I'm trying to achieve: When a user's plan ends, their listing should be hidden automatically Attempts & Suggestions: (as a non coder possible dots that could connect) JavaScript object field?.. Wix Pricing Plans Settings>Automations>Action>Run Velo Code?..Upon a plan’s end, a field of an owners item is automatically modified… The owner’s subscription status should be checked, and if their plan is ended, the field is automatically filled with a corresponding value… Using Velo I’m already able to use filters to hide repeater results. Just a need a way for a collection’s item to automatically modify itself, based on Pricing Plans Additional: • Similar tutorial: Tutorial: Using the Pricing Plans API for Pricing Plan Ordering and Payment • From Wix’s AI bot (but I’m too nooby to implement):
End listing when pricing plan ends content media
0
2
19
Sinedstro Cythan

Sinedstro Cythan

More actions
bottom of page