How To Create An Order History Page?

Mattius
Mattius Member Posts: 3

Hi,

Im thinking this might not be possible in a straight Duda solution at this point, but what Im trying to do is list "service orders" based on a specific "Member ID". Services might include things like website building, content creation etc.

I tried creating a dynamic page with a collection based on a Google sheet which houses all the information relevant for orders. Using a table widget and the new ability to connect to a collection, I did that, and created a filter based on Member ID.

Unfortunately I encountered two problems. First it only shows one order, when in some cases, there are multiple orders under the same Member ID, so the "items to display" parameter isnt actually behaving properly in this instance. And secondly, it wont work as a dynamic page because the Member ID cannot be changed. If I have a 100 dynamic pages showing order histories, it will only show, regardless of which user is logged in, the order history of one Member ID.

I could use a standard page and overcome the last problem, but im still stuck with the first and it means I have to manually create an order page for every user I have. I can duplicate it obviously with not much hassle. Maybe it can be done through Zapier somehow when a new user registers.

Anyway, any help is much appreciated.

Regards

Matt

Answers

  • community_manager
    community_manager Administrator, Moderator Posts: 297 Duda Staff

    Ooh, this is a great question @Mattius. Tagging the very talented @Elizabeth_Fedak here who might have a response, or have worked on something similar to this.

  • Mattius
    Mattius Member Posts: 3

    Still really none the wiser on this one. Any ideas to progress.

  • Elizabeth_Fedak
    Elizabeth_Fedak Member Posts: 106 MVP

    Hey @Mattius ! I don't think we can do this w/ Duda membership quite yet, but I do have an active solution w/ memberspace that can be converted to a duda-membership-friendly widget as soon as it's compatible. The main lagging factor is that I don't htink Duda provides us a way to use a Member JS API to see who is currently logged in yet. (@Sharon_Rubinstein is that coming/something we're allowed to know about!??) If you are JavaScript friendly, the gist is to use the JS API from Memberspace to obtain the active/logged in user's email/ID. Then for the content, use a JS .filter() function to get the relevant orders and display those w/ some code. Shoot me a message if you want to work together on a solution as a service, and otherwise you can also reach out to Duda Experts for a custom solution.


    And sorry for the delayed reply!! I was on a really long round the world vacation to see my in-laws and my family so I'm just getting back into the swing of things this week.

  • Mattius
    Mattius Member Posts: 3

    Hi Elizabeth. I'm actually using Memberstack. I wonder if it could be converted to work with that? I could potentially switch to Memberspace if required. I'm not locked into Memberstack (not paying a subscription) since I don't really have customers using the platform yet.

    Its definately functionality that I would like to have and preferably on my own site rather than passing users to a third party, like Stripe. Duda support got back to me with some advice that I'm yet to check into. I'll check into that today and see how it goes. If it doesnt work out, I would really appreciate any help you could provide in terms of using your solution.

    Thanks for the reply :)

  • Elizabeth_Fedak
    Elizabeth_Fedak Member Posts: 106 MVP

    @Mattius Yep, they have the same options as Memberspace for the front-end API. That part is just to obtain the actively logged in user’s email or ID so you can write code that filters the rest of your data using that parameter. I won’t be able to guide you to DIY that unless you’re a professional JS coder, in which case, do feel free to ask technical questions here. But if you’re a beginner with JS I do recommend hiring out a solution. https://support.memberstack.com/hc/en-us/articles/4407461316763-Front-end-API

    If you’re a JS developer, I recommend using the list.js library to render the filtered customer’s data.

  • Elizabeth_Fedak
    Elizabeth_Fedak Member Posts: 106 MVP
    edited May 2022

    Oops had to edit my comment as I spoke too soon.

    I'd love to see a "getCurrentUser()" function here @Duda or the ability to connect to the members collection on a dynamic page!!! https://developer.duda.co/docs/javascript-functions