Assign order to customer on checkout but charge the submitting user.
- There are two users: user-1 and user-2.
- User-1 has higher hierarchy then user-2.
- User-1 logs in to the site and adds a product to the cart, he then goes to the cart and clicks 'checkout' and is being redirected to the checkout page.
- On the checkout page user-1 fills out a form (a gravityform which we already have in place) which is a part of the checkout process. One of the fields on the form (the gravity form we attached to the product checkout (we have gravityform and woocommerce integration in place https://woocommerce.com/products/gravity-forms-add-ons/)) is "choose a customer" dropdown field. "choose a customer" field needs to autopopulate with all "customer" role users assigned to this site (in multisite).
- Once user-1 chooses a customer from the list (in this case user-2), and completes all the checkout form fields, he will then choose one of his saved payment methods (we are using stripe for woocommerce), and then user-1 will click on "submit order".
- At that moment, the payment will be processed through stripe, with the selected saved payment method of user-1. Also, the order in woocommerce will be under the "customer" name which is user-2.
The goal: So user-1 can generate reports from woocommerce and filter the data by orders that are assigned to a specific client. (so we will need to extend woocommerce report to be able to use this data in reports).
**Please note that some our products are subscriptions, and some are just simple products.
***The solution should be implemented as a custom plugin so we can maintain the changes through future theme and other plugin updates.
****Coding and testing will be done on your end. Once the plugin is successfully implemented on your end, we will schedule a Skype screen share session, so you can instruct us on what files and changes to implement where.
--Please test the solution on multiple browsers and cookie settings.
PLEASE NOTE THIS IS A WP MULTISITE ON SUB DOMAINS INSTALL.
- We are also using a role editor plugin.