ANSWERED

Extension > How do I place a person in a tree in custom code?

# Question How do I place a person in a tree in custom Extension code? # Answer Sometimes in code, you'll need to place a person in a tree. The Extension makes that possible quite easily, but the syntax isn't readily clear. ### A word of caution: > Trees are important to the business, so making mistakes here can result in a lot of work. Please make sure you're comfortable with tree structure, tree types, and that you know how to test and check the results of moves in Corp Admin. The concept of a **node** is used. This is a spot in the tree, and it "knows" about itself: who its parent is, and who it contains. The "ValidatePlacement" call you see is to make sure you don't create circular references. Here, we're placing in the "Enroller Tree". For Unilevel and Enroller tree, you need to specify the LegName as "LegName.Empty", not just "null", or you'll get a null reference exception. For Binary or Matrix trees, you can use the appropriate LegNames in that enumeration. ```csharp var _nodeId = new DirectScale.Disco.Extension.NodeId(_associate.AssociateId); var enrollernodeDetail = _treeService.GetNodeDetail(_nodeId, TreeType.Enrollment); try { _treeService.ValidatePlacements( new Placement[] { new Placement() { Tree = TreeType.Unilevel, NodeDetail = new NodeDetail() { NodeId = _nodeId, UplineId = enrollernodeDetail.UplineId, UplineLeg = LegName.Empty } } }); _treeService.Place(new Placement[] { new Placement() { Tree = TreeType.Unilevel, NodeDetail = new NodeDetail() { NodeId = _nodeId, UplineId = enrollernodeDetail.UplineId, UplineLeg = LegName.Empty } }; }); } ```
ANSWERED

Affiliate Membership Flow with Subscription Signup Before Application

**Problem:** Client has a separate business entity that will be collecting the fees for the Affiliate Membership Subscription fees. This business entity is not using the same merchant processor as the standard product ordering or Affiliate application process. We have set up a custom store (we re-used the Party store and renamed it) and have put the inventory and merchant information in this store. This project is to implement the back end ties in the Retail Shop to this custom store with a separate checkout flow on a custom page. The Client understands that because the fees to collect the Membership Subscription will be collected by one merchant and the orders placed for product will be collected through a different merchant that the user will have to enter their credit card information and check out twice. **The flow will be as follows:** 1. Home page: 1. User clicks to become an Affiliate through the banner link or clicks on the navigation bar to Join as an Affiliate. 2. Custom Membership Subscription/Checkout page: 1. This page will use storeID:? and automatically add in itemID:? (Client Membership Fee Subscription Monthly) to the cart. 2. After the user successfully enters their information to create their account and pay for their order, they will be created as associate type=1 and the order will be placed 3. Instead of being redirected to the order confirmation page, they will next go to the Application page to complete the rest of the affiliate sign up process. (/Application?type=1) 3. Application page: 1. The application page needs a new section with the order confirmation for the membership subscription fee. 2. The rest of the application will remain designed as it is today but all fields already collected (name, email, address) will be carried over to the application page. 3. NOTE: The CC info will be different so we can not take that info from the membership page to the application page. **Additional Requirements:** The user should not be able to get to the application page as a type=1 user without first going through and successfully purchasing a subscription.