Add non-store purchases to the member area

Question:
Is it possible to add a summary of purchases made outside the e-shop to the site’s member area ?

Product:
Wix Member Area

What are you trying to achieve:
I would like to add a summary of purchases made outside the e-shop, in particular via a registration form, to the site’s member area. This way, members would have a record of their membership of an association, for example.

What have you already tried:
Nothing for the moment because I’ve read that you can have this summary in the case of an e-shop, but the website doesn’t need an e-shop. The annual subscription is purchased via a form.

Additional information:
[Include any other pertinent details or information that might be helpful for people to know when trying to answer your question.]

Yes, it’s possible with cusom coding using velo. We can collect purchase information via a form, store it in a database, and display it on a personalized member page. This ensures members can securely view their records without needing an e-shop integration.

1 Like

Thanks for your reply Najma Zahid, so I understand that there’s no solution without coding. Do you know if it’s possible to retrieve information on purchases that have already been made? I can view them in the dashboard, but I don’t see where the corresponding CMS is.


In my opinion, you can see the total subscriptions, canceled, paid, and pending subscriptions in the dashboard, as well as the purchaser’s details. I also think there is a database for this called “Plans.” Let me know if I misunderstood your point so I can explain further.

Thank you very much, can you see the database corresponding to the “payments & finaces” ? Even if the Velo developer is active I can’t see the CMS database

Najma, I found the collection with the information. If I create a member page, how can I be sure that the information displayed will only be that relating to each member?

Please try to add this member area to the site at the header


When member loggedIn, member can see it’s details by click at the login panel under the “my account” section. Also member can update i’ts own details

Thank you very much Najma, I think I didn’t explain myself well. I’ve already added the member’s area to my site, so my question was, how can I add to this reserved area the information concerning the purchases via the forms that each member has made? I don’t know if it’s clear. I have a collection with the list of members and their purchases, but I don’t know how I can add the information of each member in its own area.

Yes, it’s absolutely possible to display purchase information in each member’s reserved area using Wix Velo. Since you already have a collection containing the list of members and their purchases, we can use Velo to query the database and display the relevant data for each logged-in member on their member page.

  • Database Query:
    We can use Velo’s wix-data module to query the collection for the logged-in member’s purchase data. For example, if each purchase entry in the collection includes a reference to the member ID, we can filter the collection based on the logged-in member’s ID.
  • Display on Member Page:
    After retrieving the data, we can bind it to elements like a repeater or table on the member’s reserved page. This will allow the member to view their purchase history in an organized format.
  • Logged-In Member Context:
    Velo provides access to the current logged-in member’s ID via wix-users.currentUser. We can use this to ensure that only their purchase data is displayed.
  • Implementation Example:
    Here’s a basic example of how this could look in code:

javascript

Copy code

import wixUsers from 'wix-users';
import wixData from 'wix-data';

$w.onReady(() => {
    const user = wixUsers.currentUser;
    const userId = user.id; // Get the current member's ID

    // Query the database for the member's purchases
    wixData.query("Purchases")
        .eq("memberId", userId) // Filter by member ID
        .find()
        .then((results) => {
            if (results.items.length > 0) {
                // Bind the data to a repeater or table
                $w("#purchaseRepeater").data = results.items;
            } else {
                $w("#noDataMessage").show(); // Show a message if no data
            }
        })
        .catch((err) => {
            console.error("Error fetching purchases: ", err);
        });
});
  • Reserved Area Setup:
    Ensure that the member’s area is restricted to logged-in users so that their data is secure and accessible only to them.
1 Like

thank you very much ! I’ll try and let you know.

1 Like