• I’m developing a site for a client which requires a system to record a list of transactions for a user. Each transaction would need to record the date and value of the transaction.

    My initial thought was to create a post type. However I think that is probably the wrong way to do it, especially as it would be hard to prevent WordPress from creating an actual viewable post for each transaction.

    Does anyone have any other ideas on how to handle this? User meta maybe?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    I think user meta would work well within the WP purview. Each transaction can be pushed into an array and that array stored under a particular key.

    However, if you foresee any need to crunch the data the way one might using SQL, and/or you anticipate a large number of transactions for any particular user, you would be better off creating your own table in the WP database to store the information. Of course you would need to store the user ID as well in this table in order to key it to the user table.

    Thread Starter Chris

    (@chips)

    Thanks bcworkz. At the moment I think the number of transactions per user will be quite small, under 50 for example but with the odd exception that will be 100+. I’m not sure what would be considered a large number of keys to be stored as user meta. I’m thinking the best way to go would be a new table as I will have to query it on the users account page to summarise their transactions and calculate a total.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ideas for recording user transactions’ is closed to new replies.