We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13736
    • 345 Posts
    I would like thoughts on the best way to handle this in MODx 2

    I want to setup a way to let users login and then register multiple (and possibly unlimited) products under their ID. I’m not sure the best way to do this since the total products per user is not limited.

    Any ideas from the MODx master on how to set this up?
      • 5340
      • 1,624 Posts
      Hi,

      Roughly smiley

      1. Use the Login/Register/SignUp snippets (Not sure bout the Revo names)
      2. Set up page with eForm or FormIt. On submit the information will be saved in a custom table
      3. If you want the user to manage its products set up a custom snippets that reads the above table based on the user’s id(user has to be logged in in order to access the page)
      4. Use the above snippet on a protected page.
        • 13736
        • 345 Posts
        That was basically the way I had envisioned it except for the instructions to tell FormIt to either create a new data set or edit a pre existing one. I know how it can save data to a custom field like Model Number and Serial Number, but the second time around what keeps it from overwriting the data to the same field as the first save.

        Does FormIt have a feature built in to allow it to create unlimited groups of data under each user and still keep track of it? Or maybe that’s what the custom snippet would be handling. I don’t know enough about database science to know what common practice is in such a situation.
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          Cipa nailed in on the head, you would use a custom database to store the registration information. I’m the last person to ask about building the database, but you would be storing the information as one row per product. Finding the product(s) for a client would just be a case of searching the userid column on the table and outputting the results.

          There isn’t a limit as the information would be located using the userid, your not grouping all the information on one row for all of their products.

          This shouldn’t be very difficult to setup. If you need help let me know, we did something similar for a client.

          AMDbuilder
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting