Place order for a different userID? Something like this even possible?

Hi M2 experts, I have a difficult question. I need to implement a sub account system in my shop where certain accounts can create sub accounts. I guess that would be possible but here comes the tricky part:

If the sub account places an order, the order needs to go into the main account (except the shipping address).

I was thinking about something like this:

  • Main account is “customerID=1”
  • Sub account is “customerID=2” and has a custom customer attribute of “isSubaccountOfCustomerID=1”

Before placing the order, I would check if customer is a sub account. If yes then check from which main account (“isSubaccountOfCustomerID=1”) and place the order for this customerID.

I wonder if this (or something like this) is even possible in Magento 2. If yes, how could a plugin for this look like?

Any help is really appreciated. Thank you very much.

submitted by /u/hardy123480
[link] [comments]