I am building a "multi vendor" type plugin to extend Woocommerce. There will be two types of new user roles: Vendor, and Non-Profit Org.
Vendors can list their products on the site, and users can choose at the checkout page which "Non-Profit Organization" they would like to donate part of their purchase to.
Ultimately, I would like the site owner to be able to have a curated list of all transactions, meaning how much is going to the Non Profit, how much goes to the Vendor. Preferably in chosen increments (monthly, daily, by individual order).
What’s got me stuck is figuring out how to let the "Vendor" and "Non Profit Org" accounts VIEW their respective transactions as well.
I don’t know if I should make two custom post types (Vendor Orders, Non Profit Orders) and just list extra info as Post Meta, as well as finding out a way to make sure ONLY the user assigned to the role can view orders for that role (in other words, one non profit can’t see records of another non profit).
Or, I am wondering if it makes more sense to create a custom table, which lists all valuable information (amount going to vendor, amount going to non profit, etc…) and just write custom queries to list the information based on the current user ID.